/* ============================================================
   AIPlay 登录模块 · 全新设计（Dark Premium，推翻原版）
   仅作用于登录/注册/手机号登录/绑定；功能与结构钩子不变
   ============================================================ */

/* ── 登录页氛围：纯黑 + 噪点 + 品牌光晕 + 微网格 ── */
.login-page {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 16px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.10'/%3E%3C/svg%3E"),
    radial-gradient(560px 420px at 50% 0%, rgba(50, 189, 134, .10), transparent 62%),
    radial-gradient(420px 360px at 12% 100%, rgba(50, 189, 134, .05), transparent 60%);
}
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(560px 420px at 50% 0%, #000, transparent 70%);
  mask-image: radial-gradient(560px 420px at 50% 0%, #000, transparent 70%);
}

/* ── 登录卡：全新结构 ── */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 424px;
  padding: 30px 26px 26px;
  background: #0D0D0D;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6), 0 2px 12px rgba(0, 0, 0, .35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
  animation: authCardIn .3s cubic-bezier(.22, .75, .25, 1) both;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(50, 189, 134, .55), transparent);
  pointer-events: none;
}
.auth-orb {
  position: absolute;
  top: -90px; left: 50%;
  width: 260px; height: 190px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(50, 189, 134, .22), transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.auth-card::-webkit-scrollbar { width: 5px; }
.auth-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.auth-card::-webkit-scrollbar-thumb:hover { background: rgba(50, 189, 134, .55); }

/* 品牌区 */
.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(50,189,134,.22), rgba(50,189,134,.06));
  border: 1px solid rgba(50, 189, 134, .28);
  color: #32BD86;
  box-shadow: 0 8px 22px rgba(50, 189, 134, .16);
}
.auth-brand-mark .brand-svg-icon { width: 20px; height: 20px; }
.auth-brand-name { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: #FFFFFF; }

.auth-title {
  margin: 2px 0 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -.02em;
  color: #FFFFFF;
}
.auth-sub {
  margin: -8px 0 2px;
  text-align: center;
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .5);
}

/* 圆形社交按钮行 */
.auth-social-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 2px;
}
.auth-social-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .05);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: #FFFFFF;
  cursor: pointer;
  transition: transform .18s ease-out, border-color .18s ease-out, background .18s ease-out, box-shadow .18s ease-out;
}
.auth-social-btn .brand-svg-icon { width: 21px; height: 21px; }
.auth-social-btn:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: rgba(50, 189, 134, .45);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 8px 22px rgba(50, 189, 134, .18);
}
.auth-social-btn:active { transform: scale(.94); }

/* 分隔线 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .32);
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .07);
}

/* 登录/注册分段 */
.auth-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
}
.auth-seg-btn {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, .45);
  font-size: .8rem;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
  transition: color .18s ease-out, background .18s ease-out, box-shadow .18s ease-out, transform .18s ease-out;
}
.auth-seg-btn:hover { color: rgba(255, 255, 255, .85); }
.auth-seg-btn:active { transform: scale(.97); }
.auth-seg-btn.active {
  background: #FFFFFF;
  color: #0D0D0D;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}

/* 表单区 */
.auth-fields { display: flex; flex-direction: column; gap: 10px; }
.auth-label {
  font-size: .7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .55);
  letter-spacing: .02em;
}
.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  color: #FFFFFF;
  font-size: .9rem;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  transition: border-color .18s ease-out, box-shadow .18s ease-out, background .18s ease-out;
}
.auth-input::placeholder { color: rgba(255, 255, 255, .32); font-weight: 450; }
.auth-input:focus {
  border-color: rgba(50, 189, 134, .75);
  box-shadow: 0 0 0 4px rgba(50, 189, 134, .14);
  background: #151515;
}
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .auth-input { flex: 1; }
.auth-code-btn {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: #FFFFFF;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s ease-out, transform .18s ease-out;
}
.auth-code-btn:hover { background: rgba(255, 255, 255, .05); }
.auth-code-btn:active { transform: scale(.98); }

/* 主按钮：品牌色 + 白字 + 胶囊 */
.auth-primary {
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #3CC993, #27A878);
  color: #FFFFFF;
  font-size: .92rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 14px 32px rgba(50, 189, 134, .28);
  transition: transform .18s ease-out, filter .18s ease-out, box-shadow .18s ease-out;
}
.auth-primary:hover { filter: brightness(1.08); transform: scale(1.02); box-shadow: 0 16px 36px rgba(50, 189, 134, .34); }
.auth-primary:active { transform: scale(.98); filter: brightness(.97); }
.auth-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

/* 手机号入口 */
.auth-phone-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: rgba(255, 255, 255, .85);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .18s ease-out, border-color .18s ease-out, transform .18s ease-out;
}
.auth-phone-btn:hover { background: rgba(255, 255, 255, .04); border-color: rgba(50, 189, 134, .4); color: #fff; }
.auth-phone-btn:active { transform: scale(.98); }
.auth-phone-btn .auth-phone-ic { font-size: 1rem; }

/* 登录弹窗：Glass Dialog */
.login-modal {
  background: rgba(0, 0, 0, .7);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: authDialogIn .26s cubic-bezier(.22, .75, .25, 1) both;
}
.auth-card.auth-card-modal {
  max-width: 424px;
  max-height: 88vh;
  overflow-y: auto;
  background: rgba(13, 13, 13, .9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.login-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .75);
  cursor: pointer;
  font-size: 1rem;
  transition: background .18s ease-out, transform .18s ease-out;
}
.login-modal-close:hover { background: rgba(255, 255, 255, .12); transform: scale(1.05); }
.login-modal-close:active { transform: scale(.94); }

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes authDialogIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 手机号模块：与新输入/按钮对齐 */
.phone-step {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 18px;
}
.phone-country-select,
.phone-dial,
.phone-number-input,
.phone-otp-input {
  background: #111111 !important;
  border: 1px solid rgba(255, 255, 255, .08) !important;
  border-radius: 16px !important;
  color: #FFFFFF !important;
  transition: border-color .18s ease-out, box-shadow .18s ease-out;
}
.phone-country-select:focus,
.phone-number-input:focus,
.phone-otp-input:focus {
  outline: none;
  border-color: rgba(50, 189, 134, .75) !important;
  box-shadow: 0 0 0 4px rgba(50, 189, 134, .14) !important;
}
.phone-continue-btn,
.phone-verify-btn {
  min-height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3CC993, #27A878);
  border: 0;
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(50, 189, 134, .26);
  transition: transform .18s ease-out, filter .18s ease-out;
}
.phone-continue-btn:hover,
.phone-verify-btn:hover { filter: brightness(1.08); transform: scale(1.02); }
.phone-continue-btn:active,
.phone-verify-btn:active { transform: scale(.98); filter: brightness(.97); }

/* Toast 微交互 */
.toast[data-kind="success"] { animation: authSuccessPulse .6s ease-out; }
.toast[data-kind="error"] { animation: authErrorShake .35s ease-out; }
@keyframes authSuccessPulse {
  0% { transform: scale(.97); opacity: .7; }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes authErrorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-card, .login-modal, .auth-primary, .auth-social-btn, .auth-phone-btn, .phone-continue-btn, .phone-verify-btn, .toast {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* ── 兜底：品牌全局 input/select 规则优先级更高，这里显式对齐新设计 ── */
body:not(.cms-mode) .auth-input,
body:not(.cms-mode) .phone-country-select,
body:not(.cms-mode) .phone-dial,
body:not(.cms-mode) .phone-number-input,
body:not(.cms-mode) .phone-otp-input {
  background: #111111 !important;
  color: #FFFFFF !important;
  border-color: rgba(255, 255, 255, .08) !important;
}
body:not(.cms-mode) .auth-input:focus,
body:not(.cms-mode) .phone-country-select:focus,
body:not(.cms-mode) .phone-number-input:focus,
body:not(.cms-mode) .phone-otp-input:focus {
  border-color: rgba(50, 189, 134, .75) !important;
  box-shadow: 0 0 0 4px rgba(50, 189, 134, .14) !important;
  background: #151515 !important;
}

/* ── 紧凑模式：一屏内完整展示，减少滚动 ── */
.auth-card {
  padding: 18px 20px 16px;
  gap: 8px;
  border-radius: 24px;
  max-height: calc(100vh - 40px);
}
.auth-brand-mark { width: 32px; height: 32px; border-radius: 10px; }
.auth-brand-mark .brand-svg-icon { width: 17px; height: 17px; }
.auth-brand-name { font-size: .95rem; }
.auth-title { font-size: 1.15rem; margin: 0; }
.auth-sub { font-size: .72rem; margin: -2px 0 0; }
.auth-social-row { gap: 10px; margin-top: 0; }
.auth-social-btn { width: 40px; height: 40px; }
.auth-social-btn .brand-svg-icon { width: 18px; height: 18px; }
.auth-divider { margin: 0; }
.auth-seg-btn { min-height: 36px; font-size: .78rem; }
.auth-fields { gap: 6px; }
.auth-label { font-size: .66rem; }
.auth-input { min-height: 42px; padding: 0 13px; font-size: .86rem; }
.auth-code-row { gap: 6px; }
.auth-code-btn { min-height: 42px; padding: 0 12px; font-size: .7rem; }
.auth-primary { min-height: 46px; font-size: .88rem; margin-top: 2px; }
.auth-phone-btn { min-height: 40px; font-size: .78rem; }
.auth-card.auth-card-modal { max-height: calc(100vh - 32px); }
.phone-step { padding: 10px 12px; gap: 6px; }
.phone-step-title { font-size: .84rem; }
.phone-continue-btn, .phone-verify-btn { min-height: 42px; }

/* ── 固定页面：登录页精确撑满可视区，禁止页面滚动 ── */
.login-page {
  height: calc(100dvh - var(--header-height, 52px) - var(--nav-height, 60px) - env(safe-area-inset-bottom, 0px));
  min-height: 0;
  overflow: hidden;
  padding: 8px 16px;
  align-items: center;
  justify-content: center;
}
.auth-card,
.auth-card.auth-card-modal {
  max-height: 100%;
}

/* ── 游客登录视图：整页锁定，禁止上下滚动 ── */
body.login-view-active {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
body.login-view-active #app {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}
body.login-view-active footer { display: none; }

/* ── 手机号流程返回按钮 ── */
.phone-step-head {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin-bottom: 4px;
}
.phone-step-head .phone-step-title {
  flex: 1;
  text-align: center;
  margin: 0;
}
.phone-back-top {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  font-family: inherit;
  transition: background .18s ease-out, transform .18s ease-out;
}
.phone-back-top .brand-svg-icon { width: 16px; height: 16px; }
.phone-back-top:hover { background: rgba(255, 255, 255, .1); transform: scale(1.05); }
.phone-back-top:active { transform: scale(.94); }
