/* 乐达星海 · 导航用户组件 */
.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(51, 112, 255, 0.35);
  background: rgba(51, 112, 255, 0.08);
  color: #1D4ED8;
  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(51, 112, 255, 0.14);
  border-color: rgba(51, 112, 255, 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 #DEE0E3;
  background: #fff;
  color: #1F2329;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.wx-nav-user-btn:hover {
  border-color: rgba(51, 112, 255, 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: #EFF4FF;
  color: #1456F0;
}

.wx-nav-user-name {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-nav-user-caret {
  font-size: 0.75rem;
  color: #646A73;
}

.wx-nav-user-menu {
  min-width: 12.5rem;
  padding: 0.4rem 0;
  border-radius: 0.75rem;
  border: 1px solid #DEE0E3;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  margin-top: 0.35rem;
}

.wx-nav-user-menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.wx-nav-user-menu a:hover {
  background: #EFF4FF;
  color: #1D4ED8;
}

.wx-nav-user-menu a i {
  width: 1rem;
  text-align: center;
  color: #3370FF;
}

.wx-nav-logout-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 1rem;
  border: 0;
  border-top: 1px solid #F2F3F5;
  margin-top: 0.25rem;
  background: transparent;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.wx-nav-logout-btn i {
  width: 1rem;
  text-align: center;
  color: #8F959E;
}

.wx-nav-logout-btn:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.wx-nav-logout-btn:hover i {
  color: #ef4444;
}

.wx-nav-user-btn {
  max-width: min(100%, 14rem);
}

.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 #DEE0E3;
  background: #fff;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.wx-mobile-user-link:hover {
  border-color: rgba(51, 112, 255, 0.45);
  color: #1D4ED8;
}

@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 #DEE0E3;
  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 #F2F3F5;
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.account-stat strong {
  display: block;
  font-size: 1.25rem;
  color: #1D4ED8;
}

.account-list-item {
  border: 1px solid #F2F3F5;
  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 #DEE0E3;
  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: #8F959E;
  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: #2B2F36;
  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: #1D4ED8;
}

.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: #1456F0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.wx-login-divider {
  text-align: center;
  color: #8F959E;
  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 #F2F3F5;
}

.wx-login-qr--loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F0F5FF 0%, #EFF4FF 100%);
  border: 1px dashed #3370FF;
  box-sizing: border-box;
}

.wx-login-qr-loading-text {
  font-size: 0.8125rem;
  color: #1D4ED8;
  padding: 0.5rem;
  text-align: center;
  line-height: 1.4;
}

.wx-login-qr-refresh {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  border: 1px solid #3370FF;
  border-radius: 0.5rem;
  background: #fff;
  color: #1D4ED8;
  cursor: pointer;
}

.wx-login-qr-check {
  margin-left: 0.35rem;
  background: #EFF4FF;
}

.wx-login-qr-hint {
  font-size: 0.8125rem;
  color: #2B2F36;
  margin-top: 0.35rem;
}

.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: #3370FF;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.wx-login-status {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #646A73;
}

.wx-login-status.is-ok {
  color: #1D4ED8;
}

.wx-login-status.is-err {
  color: #b91c1c;
}

.wx-nav-verified-btn {
  background: rgba(51, 112, 255, 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%;
  }
}

.wx-login-api-down {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #9a3412;
}

.wx-login-api-down code {
  font-size: 0.75rem;
  background: #ffedd5;
  padding: 0 0.25rem;
  border-radius: 4px;
}
