/* ============================================================
   Auth Overlay V3 — 多画风拼贴墙背景
   全屏拼贴 · 暗色遮罩 · 毛玻璃卡片 · 渐变按钮
   ============================================================ */

/* ── 全屏遮罩：多画风拼贴墙背景 ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060a10 url('/images/auth_bg.png') center center / cover no-repeat;
  overflow: hidden;
}

/* 暗色遮罩 — 确保登录卡片文字可读 */
.auth-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(6,10,16,0.20) 0%, rgba(6,10,16,0.50) 100%);
  z-index: 0;
}

/* 缓慢微缩放 — 增加电影感 */
@keyframes authBgZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

/* 右上角光晕 */
.auth-overlay::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: radial-gradient(circle, rgba(79,141,245,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── 主卡片：毛玻璃 ── */
.auth-container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(860px, 90vw);
  min-height: 480px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(15, 20, 30, .65);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.06);
  box-shadow:
    0 32px 100px rgba(0,0,0,.6),
    0 0 1px rgba(255,255,255,.08),
    inset 0 1px 0 rgba(255,255,255,.04);
}

/* ══════════════════════════════════════
   左侧品牌面板 — 极光/星云
   ══════════════════════════════════════ */
.auth-brand {
  position: relative;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

/* 极光渐变背景 */
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg,
      rgba(88, 28, 135, .6) 0%,
      rgba(79, 141, 245, .3) 30%,
      rgba(34, 197, 94, .15) 50%,
      rgba(163, 113, 247, .4) 70%,
      rgba(236, 72, 153, .2) 100%
    );
  animation: auroraShift 10s ease-in-out infinite alternate;
}

@keyframes auroraShift {
  0% { filter: hue-rotate(0deg) brightness(1); }
  50% { filter: hue-rotate(15deg) brightness(1.1); }
  100% { filter: hue-rotate(-10deg) brightness(.95); }
}

/* 极光光柱 */
.auth-brand::after {
  content: '';
  position: absolute;
  width: 300%;
  height: 300%;
  top: -100%;
  left: -100%;
  background:
    radial-gradient(ellipse at 40% 50%, rgba(120,200,255,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 30%, rgba(180,100,255,.08) 0%, transparent 40%);
  animation: auroraWave 12s ease-in-out infinite alternate;
}

@keyframes auroraWave {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(20px, -30px) rotate(3deg); }
}

.auth-brand-mark {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  box-shadow:
    0 8px 32px rgba(124,58,237,.4),
    0 0 0 1px rgba(255,255,255,.1);
  letter-spacing: -1px;
}

.auth-brand h1 {
  position: relative;
  z-index: 1;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  letter-spacing: 2px;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.auth-brand p {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,.5);
  margin: 0 0 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.auth-brand-tagline {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: rgba(255,255,255,.6);
  line-height: 1.8;
  letter-spacing: .5px;
}

/* ══════════════════════════════════════
   右侧表单面板
   ══════════════════════════════════════ */
.auth-form-panel {
  padding: 44px 40px 28px;
  display: flex;
  flex-direction: column;
  background: rgba(13, 17, 23, .4);
}

/* Tab 切换 */
.auth-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  justify-content: center;
}

.auth-tab {
  padding: 8px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.35);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
  letter-spacing: 1px;
}

.auth-tab:hover { color: rgba(255,255,255,.7); }
.auth-tab.active {
  color: #fff;
  border-bottom-color: #a855f7;
}

/* 表单 */
.auth-form { flex: 1; }

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  margin-bottom: 8px;
  letter-spacing: .5px;
}

.auth-field input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  color: #e6edf3;
  font-size: 14px;
  transition: all .25s;
  box-sizing: border-box;
}

.auth-field input:focus {
  border-color: rgba(168,85,247,.5);
  box-shadow: 0 0 0 3px rgba(168,85,247,.1), 0 0 20px rgba(168,85,247,.05);
  background: rgba(255,255,255,.06);
  outline: none;
}

.auth-field input::placeholder {
  color: rgba(255,255,255,.2);
}

.auth-optional {
  font-weight: 400;
  color: rgba(255,255,255,.25);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

/* 错误提示 */
.auth-error {
  background: var(--brand-danger-tint, rgba(248,81,73,.08));
  border: 1px solid rgba(248,81,73,.2);
  color: var(--brand-danger, #f85149);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
}

/* 登录按钮 — 渐变 */
.auth-submit {
  width: 100%;
  padding: 13px 0;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  margin-top: 8px;
  letter-spacing: 4px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #4f8df5 50%, #a855f7 100%);
  background-size: 200% 100%;
  transition: all .3s;
  box-shadow: 0 4px 20px rgba(124,58,237,.3);
}

.auth-submit:hover {
  background-position: 100% 0;
  box-shadow: 0 6px 28px rgba(124,58,237,.45);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(124,58,237,.3);
}

.auth-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* 底部跳过 */
.auth-footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
}

.auth-skip {
  font-size: 12px;
  color: rgba(255,255,255,.25) !important;
  background: none !important;
  border: none !important;
  cursor: pointer;
  transition: color .2s;
  letter-spacing: .5px;
}
.auth-skip:hover { color: rgba(255,255,255,.5) !important; }

/* ── 响应式 ── */
@media (max-width: 700px) {
  .auth-container {
    grid-template-columns: 1fr;
    min-height: auto;
    width: 92vw;
  }
  .auth-brand {
    padding: 32px 20px;
    min-height: 200px;
  }
  .auth-brand-tagline { display: none; }
  .auth-form-panel { padding: 28px 24px 20px; }
}

/* §3.5 手机端 · 紧凑布局 */
@media (max-width: 600px) {
  .auth-container {
    grid-template-columns: 1fr;
    width: 96vw;
    border-radius: 14px;
  }
  .auth-brand {
    padding: 20px 16px;
    min-height: auto;
    flex-direction: row;
    gap: 12px;
    text-align: left;
    justify-content: flex-start;
  }
  .auth-brand-mark {
    width: 44px;
    height: 44px;
    font-size: 18px;
    border-radius: 12px;
    margin-bottom: 0;
  }
  .auth-brand h1 {
    font-size: 18px;
    margin: 0;
    letter-spacing: 1px;
  }
  .auth-brand p,
  .auth-brand-tagline {
    display: none;
  }
  .auth-form-panel {
    padding: 20px 18px 16px;
  }
  .auth-tabs {
    gap: 16px;
    margin-bottom: 20px;
  }
  .auth-tab {
    font-size: 14px;
  }
  .auth-field {
    margin-bottom: 14px;
  }
  .auth-field input {
    padding: 10px 14px;
    font-size: 15px;
  }
  .auth-submit {
    padding: 14px 0;
    font-size: 16px;
    margin-top: 12px;
  }
  /* 退出 modal 也适配 */
  .auth-logout-card {
    padding: 28px 24px 20px;
  }
}

/* ══════════════════════════════════════
   §3.3 成功 Toast (登录/注册)
   ══════════════════════════════════════ */
.auth-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 10001;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.auth-toast-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 8px 32px rgba(34,197,94,.35);
}

/* §3.3 Overlay 淡出 */
.auth-overlay.auth-fade-out {
  animation: authFadeOut .6s ease forwards;
}
@keyframes authFadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.02); }
}

/* ══════════════════════════════════════
   §4.5 退出确认 Modal
   ══════════════════════════════════════ */
.auth-logout-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-logout-card {
  background: var(--bg-card, #1d2028);
  border: 1px solid var(--border-color, rgba(255,255,255,0.08));
  border-radius: 16px;
  padding: 36px 40px 28px;
  text-align: center;
  width: min(380px, 88vw);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: authModalIn .2s ease-out;
}

@keyframes authModalIn {
  0% { opacity: 0; transform: scale(0.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-logout-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.auth-logout-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #e2e4ea);
}

.auth-logout-card p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-secondary, #9da1ad);
  line-height: 1.6;
}

.auth-logout-actions {
  display: flex;
  gap: 12px;
}

.auth-logout-actions .btn {
  flex: 1;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}

.auth-logout-confirm-btn {
  background: var(--brand-danger, #ef4444) !important;
  border: none !important;
  color: #fff !important;
}
.auth-logout-confirm-btn:hover {
  background: var(--brand-danger-hover, #dc2626) !important;
  box-shadow: 0 4px 16px rgba(239,68,68,.35);
}

/* ══════════════════════════════════════
   §4.3 + §4.4 · Popup 用户菜单
   ══════════════════════════════════════ */
.auth-user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1a24;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 6px 0;
  z-index: 1000;
}

.auth-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
  font-family: inherit;
}

/* §4.4 左侧 accent 条 hover */
.auth-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--accent-blue, #4f8df5), var(--accent-purple, #a78bfa));
  opacity: 0;
  transition: opacity .15s;
}

.auth-menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.auth-menu-item:hover::before {
  opacity: 1;
}

.auth-menu-item svg {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity .12s;
}
.auth-menu-item:hover svg {
  opacity: 1;
}

/* 退出登录 — 危险色 */
.auth-menu-danger {
  color: #f87171;
}
.auth-menu-danger:hover {
  background: rgba(248,113,113,0.08);
}
.auth-menu-danger::before {
  background: #ef4444;
}

/* 分隔线 */
.auth-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 8px;
}

/* ── 浅色模式：popup 仍在深色 sidebar 内 · 强制白色文字 ── */
[data-theme="light"] .auth-user-menu {
  background: #1a1a24;
  border-color: rgba(255,255,255,0.1);
}
[data-theme="light"] .auth-menu-item {
  color: rgba(255,255,255,0.85);
}
[data-theme="light"] .auth-menu-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
[data-theme="light"] .auth-menu-danger {
  color: #f87171;
}
[data-theme="light"] .auth-menu-danger:hover {
  background: rgba(248,113,113,0.1);
  color: #f87171;
}
[data-theme="light"] .auth-menu-divider {
  background: rgba(255,255,255,0.08);
}
[data-theme="light"] .auth-menu-item svg {
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] #authUserName {
  color: rgba(255,255,255,0.9) !important;
}
[data-theme="light"] #authUserRole {
  color: rgba(255,255,255,0.4) !important;
}

/* ============================================================
   §V10.5 反重力 §2.4 captcha brand polish (13号 代反重力 · 2026-05-03)
   派单 docs/PING_13HAO_12HAO_8HAO_ANTI_GRAVITY_UI_TAKEOVER §2 件 2
   登录页 captcha 视觉 100% V10.1 brand token (反重力 §2.1 真稿)
   反重力恢复后增量 polish (不撤代做)
   ============================================================ */

/* 验证码行 (覆盖 inline style style="display:flex" 不动 · 加 spacing/responsive) */
.auth-captcha-row {
  position: relative;
}

/* 验证码输入框 · brand-primary focus ring */
#authRegCaptcha {
  letter-spacing: 0.15em;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  text-transform: uppercase;
  transition: border-color var(--duration-fast, 150ms),
              box-shadow var(--duration-fast, 150ms);
}

#authRegCaptcha:focus {
  border-color: var(--brand-primary, #8b5cf6);
  box-shadow: 0 0 0 3px var(--brand-primary-ring, rgba(139, 92, 246, 0.4));
  outline: none;
}

/* 错误态 (auth-error 显示后 captcha 可能错误 · 加 .has-error class auth.js 后续切) */
#authRegCaptcha.has-error {
  border-color: var(--brand-danger, #ef4444);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.20);
  animation: captchaShake 0.32s var(--ease-default, ease-out);
}

@keyframes captchaShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* 验证码图片 · 紫色 hover ring + 点击刷新动画 */
.auth-captcha-img {
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.06));
  background: var(--bg-elevated, #21262d);
  transition: border-color var(--duration-fast, 150ms),
              transform var(--duration-fast, 150ms),
              box-shadow var(--duration-fast, 150ms);
  user-select: none;
  -webkit-user-drag: none;
}

.auth-captcha-img:hover {
  border-color: var(--brand-primary, #8b5cf6);
  box-shadow: 0 0 0 2px var(--brand-primary-ring, rgba(139, 92, 246, 0.4));
}

.auth-captcha-img:active {
  transform: scale(0.96) rotate(-3deg);
  border-color: var(--brand-primary-hover, #7c3aed);
}

.auth-captcha-img:focus-visible {
  outline: 2px solid var(--brand-primary-ring, rgba(139, 92, 246, 0.4));
  outline-offset: 2px;
}

/* 加载态 (auth.js 重新拉图时加 .loading class) */
.auth-captcha-img.loading {
  opacity: 0.55;
  filter: grayscale(0.5);
  cursor: wait;
}

/* §V11.6 件 E (13号 5/2) · 移动响应式 captcha 触摸友好 (跟 --touch-min 配套) */
@media (max-width: 480px) {
  .auth-captcha-img {
    height: 44px !important;  /* override inline style 38px → touch-min 44 */
    min-width: 90px;
  }
  #authRegCaptcha {
    min-height: var(--touch-min, 44px);
  }
}
