/* ==========================================================================
   登录 / 注册右侧滑出抽屉（全局，未登录访客）
   视觉沿用 mimangfei-design/auth.html 表单面板；从右侧滑出 + 左侧遮罩。
   ========================================================================== */

.auth-drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(4, 20, 24, 0.52);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.auth-drawer-mask.is-open {
  opacity: 1;
  visibility: visible;
}

.auth-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(92vw, 480px);
  z-index: 99;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--sh-lg, -24px 0 60px rgba(4, 20, 24, 0.22));
  transform: translateX(100%);
  transition: transform 0.44s var(--ease-out);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.auth-drawer.is-open {
  transform: none;
}

.auth-drawer__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.auth-drawer__inner {
  padding: clamp(30px, 5vw, 52px) clamp(24px, 4vw, 46px) 56px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-drawer__inner .brand {
  align-self: flex-start;
}

/* ===== 选项卡 ===== */
.auth-drawer .auth-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  margin-bottom: 26px;
}
.auth-drawer .auth-tabs button {
  flex: 1;
  height: 42px;
  border-radius: var(--r-full);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--muted);
  transition: 0.25s var(--ease-out);
}
.auth-drawer .auth-tabs button.is-active {
  background: var(--surface);
  color: var(--brand-700);
  box-shadow: var(--sh-sm);
}

/* ===== 表单 ===== */
.auth-drawer .mf-auth-form {
  display: flex;
  flex-direction: column;
}
.auth-drawer .mf-auth-form > .row-between {
  align-items: center;
}

.mf-auth-msg {
  display: none;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 0.86rem;
  line-height: 1.6;
}
.mf-auth-msg.is-error {
  display: block;
  background: color-mix(in srgb, #DC2626 12%, transparent);
  color: #B91C1C;
  border: 1px solid color-mix(in srgb, #DC2626 26%, transparent);
}
.mf-auth-msg.is-success {
  display: block;
  background: color-mix(in srgb, var(--brand-500) 14%, transparent);
  color: var(--brand-700);
  border: 1px solid color-mix(in srgb, var(--brand-500) 30%, transparent);
}

[data-theme="dark"] .mf-auth-msg.is-error {
  color: #FCA5A5;
}

/* ===== 社交登录 ===== */
.auth-drawer .social-login {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.auth-drawer .social-login a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  transition: 0.22s;
  background: var(--surface);
}
.auth-drawer .social-login a:hover {
  border-color: var(--brand-400);
  color: var(--brand-600);
  transform: translateY(-2px);
}
.auth-drawer .social-login svg {
  width: 18px;
  height: 18px;
}

/* ===== 人机验证（插件图片验证码字段适配） ===== */
.mf-auth-captcha .mfm-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mf-auth-captcha .mfm-item > label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-2);
}
.mf-auth-captcha .mfm-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mf-auth-captcha .mfm-captcha-row input {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
}
.mf-auth-captcha .mfm-captcha-img {
  height: 48px;
  width: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--surface-3);
}

/* ===== 移动端 ===== */
@media (max-width: 560px) {
  .auth-drawer {
    width: 100%;
    border-left: 0;
  }
}