/* 子页顶栏「我」/ 登录（无首页 btnOpenMy 时，与 hub-btn-my 同构） */
.meixier-auth-chip.hub-btn-my {
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.meixier-auth-chip .hub-btn-my__ring {
  width: 38px;
  height: 38px;
}

.meixier-auth-chip .hub-btn-my__fallback {
  font-size: 0.95rem;
  min-height: 38px;
}

/* 未登录 · 胶囊「登录」 */
.meixier-auth-chip:not(.is-in) .hub-btn-my__ring {
  width: auto;
  height: auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 220, 200, 0.28);
  background: rgba(20, 10, 16, 0.55);
}

.meixier-auth-chip:not(.is-in) .hub-btn-my__fallback {
  min-height: 32px;
  padding: 0 2px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 235, 220, 0.92);
}

.meixier-auth-chip {
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.meixier-auth-chip:hover {
  border-color: rgba(255, 200, 170, 0.5);
  background: rgba(30, 14, 22, 0.72);
}

.meixier-auth-chip.is-in {
  border-color: rgba(255, 180, 140, 0.45);
  color: #ffe8d8;
}

body.meixier-logged-in .meixier-auth-chip:not(.is-in) {
  display: none;
}

/* 邮箱登录 / 注册浮层 — 与 521 情缘典主题一致 */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
}

.auth-modal.hidden {
  display: none !important;
}

.auth-modal:not(.hidden) {
  display: flex !important;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(12, 6, 10, 0.72);
  backdrop-filter: blur(6px);
}

.auth-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  max-height: min(92vh, 640px);
  overflow: auto;
  border-radius: 16px;
  padding: 26px 22px 22px;
  background: linear-gradient(165deg, #2a1020 0%, #1a0a14 55%, #120810 100%);
  border: 1px solid rgba(212, 168, 106, 0.35);
  box-shadow:
    0 0 0 1px rgba(232, 120, 152, 0.15),
    0 24px 64px rgba(0, 0, 0, 0.55);
  animation: authModalIn 0.35s ease;
}

@keyframes authModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-soft, #c4a8b0);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal__brand {
  text-align: center;
  margin-bottom: 18px;
}

.auth-modal__brand .tag {
  font-size: 0.72rem;
  letter-spacing: 0.35em;
  color: var(--gold, #d4a86a);
  margin: 0 0 6px;
}

.auth-modal__lead {
  margin: 0 0 14px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: rgba(245, 230, 235, 0.72);
}

.auth-modal__brand h2 {
  font-family: var(--font-display, 'Ma Shan Zheng', cursive);
  font-size: 1.65rem;
  font-weight: 400;
  color: #f4d4e0;
  margin: 0 0 4px;
}

.auth-modal__brand p {
  font-size: 0.82rem;
  color: var(--text-muted, #9a6b7a);
  margin: 0;
}

.auth-modal__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.auth-modal__tab {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-modal__tab.is-active {
  background: linear-gradient(135deg, var(--rose-deep, #a82848), var(--rose, #c43858));
  color: #fff8f5;
  box-shadow: 0 4px 16px rgba(196, 56, 88, 0.35);
}

.auth-modal__form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-modal__form.is-active {
  display: flex;
}

.auth-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--gold-dim, #c9a060);
  margin-bottom: 6px;
  letter-spacing: 0.08em;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 106, 0.3);
  background: rgba(255, 250, 246, 0.06);
  color: #fff8f5;
  font-size: 1rem;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--rose, #e87898);
  box-shadow: 0 0 0 2px rgba(232, 120, 152, 0.25);
}

.auth-field input::placeholder {
  color: rgba(196, 168, 176, 0.55);
}

.auth-field__hint {
  margin: 6px 0 0;
  font-size: 0.68rem;
  line-height: 1.4;
  color: rgba(196, 168, 176, 0.75);
}

.auth-modal__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -4px 0 0;
}

.auth-modal__error {
  font-size: 0.82rem;
  color: #f08080;
  min-height: 1.2em;
  text-align: center;
}

.auth-modal__submit {
  margin-top: 4px;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--rose-deep) 0%, var(--rose) 50%, var(--gold-dim) 100%);
  color: #fff8f5;
  box-shadow: 0 8px 24px rgba(196, 56, 88, 0.4);
}

.auth-modal__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-modal__foot {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.auth-modal__foot button {
  border: none;
  background: none;
  color: var(--rose, #e890a8);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}

/* 顶栏登录态 */
.site-header__auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 8px;
}

.btn-auth-entry {
  border: 1px solid rgba(212, 168, 106, 0.45);
  background: rgba(42, 16, 32, 0.65);
  color: var(--gold, #e8d4b8);
  font-size: 0.78rem;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-auth-entry:hover {
  border-color: var(--rose, #e87898);
  color: #fff8f5;
}

.site-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 160px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(42, 16, 32, 0.75);
  border: 1px solid rgba(212, 168, 106, 0.35);
  cursor: pointer;
}

.site-user-chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose-deep), var(--gold-dim));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff8f5;
  flex-shrink: 0;
}

.site-user-chip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--text-soft);
  line-height: 1.3;
}

.site-user-chip__text strong {
  display: block;
  color: #f4d4e0;
  font-weight: 600;
  font-size: 0.78rem;
}

.my-account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(196, 56, 88, 0.12), rgba(212, 168, 106, 0.1));
  border: 1px solid rgba(212, 168, 106, 0.28);
}

.my-account-bar__email {
  font-size: 0.82rem;
  color: #f4d4e0;
  word-break: break-all;
}

.my-account-bar__role {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-auth-logout {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 168, 106, 0.4);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}

@media (max-width: 480px) {
  .site-header {
    flex-wrap: wrap;
  }
  .site-header__auth {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 4px 0 0;
  }
}

.auth-modal--has-wechat .auth-modal__panel {
  max-width: min(440px, calc(100vw - 24px));
  padding: 22px 20px 20px;
}

@media (min-width: 420px) {
  .auth-modal--has-wechat .auth-modal__panel {
    max-width: 440px;
  }
}

/* 扫码登录 · 微信大码竖版 */
.auth-modal__social {
  margin-bottom: 14px;
}

.auth-wechat-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 4px 2px;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(7, 193, 96, 0.1) 0%, rgba(0, 0, 0, 0.28) 45%, rgba(42, 16, 32, 0.35) 100%);
  border: 1px solid rgba(7, 193, 96, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-wechat-hero__head {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  padding: 14px 12px 10px;
}

.auth-wechat-hero__brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(7, 193, 96, 0.2);
  color: #9ef0c4;
  box-shadow: 0 0 0 1px rgba(7, 193, 96, 0.35);
}

.auth-wechat-hero__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f0fff5;
  letter-spacing: 0.06em;
}

.auth-modal__badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #063d24;
  background: linear-gradient(135deg, #b8f5d4, #07c160);
  box-shadow: 0 2px 8px rgba(7, 193, 96, 0.35);
}

.auth-wechat-qr {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 4px 8px 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.auth-wechat-qr:hover {
  transform: translateY(-1px);
}

.auth-wechat-qr:active {
  transform: scale(0.99);
}

.auth-wechat-qr__glow {
  position: absolute;
  top: 8px;
  left: 50%;
  width: clamp(220px, 82vw, 280px);
  height: clamp(220px, 82vw, 280px);
  transform: translateX(-50%);
  border-radius: 22px;
  background: radial-gradient(circle at 50% 45%, rgba(7, 193, 96, 0.32), transparent 70%);
  pointer-events: none;
  animation: authWechatGlow 3s ease-in-out infinite;
}

@keyframes authWechatGlow {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(-50%) scale(0.98);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.02);
  }
}

.auth-wechat-qr__plate {
  position: relative;
  width: clamp(200px, 76vw, 240px);
  height: clamp(200px, 76vw, 240px);
  padding: 16px;
  box-sizing: border-box;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffef9 0%, #f4faf6 100%);
  box-shadow:
    0 0 0 1px rgba(7, 193, 96, 0.38),
    0 16px 48px rgba(0, 0, 0, 0.38),
    0 0 32px rgba(7, 193, 96, 0.14);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.auth-wechat-qr:hover .auth-wechat-qr__plate {
  box-shadow:
    0 0 0 2px rgba(7, 193, 96, 0.45),
    0 20px 52px rgba(7, 193, 96, 0.18),
    0 0 36px rgba(7, 193, 96, 0.2);
}

.auth-wechat-qr.is-ready .auth-wechat-qr__plate,
.auth-wechat-qr:focus-visible .auth-wechat-qr__plate {
  box-shadow:
    0 0 0 2px rgba(7, 193, 96, 0.55),
    0 16px 48px rgba(7, 193, 96, 0.2);
}

.auth-wechat-qr__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: #07c160;
  border-style: solid;
  z-index: 2;
}

.auth-wechat-qr__corner--tl {
  top: 10px;
  left: 10px;
  border-width: 3px 0 0 3px;
  border-radius: 4px 0 0 0;
}

.auth-wechat-qr__corner--tr {
  top: 10px;
  right: 10px;
  border-width: 3px 3px 0 0;
  border-radius: 0 4px 0 0;
}

.auth-wechat-qr__corner--bl {
  bottom: 10px;
  left: 10px;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 4px;
}

.auth-wechat-qr__corner--br {
  bottom: 10px;
  right: 10px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 4px 0;
}

.auth-wechat-qr__matrix {
  position: absolute;
  inset: 14px;
  border-radius: 8px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, rgba(20, 30, 25, 0.88) 2px, transparent 2px),
    linear-gradient(rgba(20, 30, 25, 0.88) 2px, transparent 2px),
    linear-gradient(90deg, rgba(20, 30, 25, 0.45) 1px, transparent 1px),
    linear-gradient(rgba(20, 30, 25, 0.45) 1px, transparent 1px);
  background-size:
    24px 24px,
    24px 24px,
    8px 8px,
    8px 8px;
  background-position:
    4px 4px,
    4px 4px,
    0 0,
    0 0;
  opacity: 0.92;
}

.auth-wechat-qr__center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 5px #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.auth-wechat-qr__logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #07c160;
  background: linear-gradient(145deg, rgba(7, 193, 96, 0.14), rgba(7, 193, 96, 0.28));
}

.auth-wechat-qr__scan {
  position: absolute;
  left: 12%;
  right: 12%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #07c160, transparent);
  box-shadow: 0 0 12px rgba(7, 193, 96, 0.75);
  animation: authQrScan 2.2s ease-in-out infinite;
  z-index: 4;
  pointer-events: none;
}

@keyframes authQrScan {
  0%,
  100% {
    top: 14%;
    opacity: 0.35;
  }
  50% {
    top: 82%;
    opacity: 1;
  }
}

.auth-wechat-qr__tap {
  font-size: 0.78rem;
  color: rgba(245, 230, 235, 0.75);
  letter-spacing: 0.04em;
}

.auth-wechat-qr__status {
  font-size: 0.72rem;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(196, 168, 176, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-wechat-qr__status.is-ready {
  background: rgba(7, 193, 96, 0.18);
  color: #9ef0c4;
  border-color: rgba(7, 193, 96, 0.4);
}

button.auth-wechat-qr.is-ready .auth-wechat-qr__plate {
  animation: authQrPulse 2.5s ease-in-out infinite;
}

@keyframes authQrPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.015);
  }
}

.auth-wechat-steps {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 12px 4px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
}

.auth-wechat-steps li {
  flex: 1;
  max-width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: rgba(220, 235, 225, 0.88);
  text-align: center;
  line-height: 1.3;
}

.auth-wechat-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ef0c4;
  background: rgba(7, 193, 96, 0.2);
  border: 1px solid rgba(7, 193, 96, 0.35);
}

.auth-wechat-hero__hint {
  margin: 0 0 12px;
  padding: 0 12px;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(196, 168, 176, 0.85);
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 16px;
  color: rgba(196, 168, 176, 0.65);
  font-size: 0.72rem;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 106, 0.35), transparent);
}

.auth-modal__divider span {
  white-space: nowrap;
  letter-spacing: 0.12em;
}
