/* ================================================================
   认证页 组件库：毛玻璃 · 轻奢现代 · Glassmorphism
   适用于 login / reg 页面
   颜色跟随全局主题换肤（theme.js 设置 --primary 系列 CSS 变量）
   ================================================================ */

:root {
  /* 主题兜底变量（theme.js 无已保存主题时不调用 apply()，依赖此默认值） */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-mid: #76a3ff;
  --primary-deep: #1e40af;
  --primary-light: rgba(37,99,235,.12);
  --primary-soft: rgba(37,99,235,.12);
  --primary-rgb: 37,99,235;
  --primary-glow: rgba(37,99,235,.28);
  /* 毛玻璃专用变量 */
  --glass: rgba(255,255,255,.62);
  --glass-2: rgba(255,255,255,.45);
  --glass-border: rgba(255,255,255,.55);
  --glass-inset: rgba(255,255,255,.50);
  --bg: #eef2ff;
  --text: #1a2332;
  --text-2: #5f6b7a;
  --text-3: #95a3b3;
  --border: rgba(228,232,238,.70);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 24px;
  --shadow: 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(31,38,135,.10);
  --danger: #ef4444;
  --warn: #f59e0b;
  --success: #22c55e;
  --header-h: 64px;
}

* { box-sizing: border-box; }

/* ===== 渐变背景 + 装饰光斑（跟随主题色） ===== */
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,"Microsoft YaHei","PingFang SC",sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overscroll-behavior: none; /* 阻断滚动链，防止抽屉/弹窗 iframe 拖动整页导致弹窗暴露 */
  /* 顶部固定导航 64px + 留白；底部为手机端 TabBar 留位 */
  padding: calc(var(--header-h) + 28px) 16px calc(70px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse at 15% 20%, rgba(var(--primary-rgb),.18) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(139,92,246,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(14,165,233,.08) 0%, transparent 60%),
    linear-gradient(135deg, #eef2ff 0%, #f0f4ff 30%, #e8f0fe 70%, #f5f0ff 100%);
  position: relative;
  overflow: auto;
}
html { height: 100%; overscroll-behavior: none; /* 阻断 iframe 根滚动器滚动链（必须写在 html 上，body 上无效） */ }
/* 手机端顶部导航隐藏，收窄上边距 */
@media (max-width: 991px) {
  body { padding-top: 28px; }
}
/* ===== 隐藏滚动条（保留滚动能力），用于弹窗 iframe 内 ===== */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { width: 0; height: 0; background: transparent; }
html { scrollbar-width: none; -ms-overflow-style: none; }
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}
body::before {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.22), transparent 70%);
  top: -120px; left: -80px;
  animation: float1 18s ease-in-out infinite;
}
body::after {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(139,92,246,.18), transparent 70%);
  bottom: -100px; right: -60px;
  animation: float2 22s ease-in-out infinite;
}
@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(60px,40px) scale(1.1); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-50px,-30px) scale(1.15); }
}

a { text-decoration: none; color: var(--primary); }
br { display: none; }

/* ===== 底部导航（与用户中心 mobile-tabbar 一致，仅手机端显示） ===== */
.mobile-tabbar { display: none; }
@media (max-width: 992px) {
  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.05);
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-tabbar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 3px 0 2px;
    text-decoration: none;
    color: var(--text-light, #9ca3af);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 48px;
  }
  .mobile-tabbar .tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 28px;
    line-height: 1;
    border-radius: 14px;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.22s ease, color 0.22s ease;
  }
  .mobile-tabbar .tab-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .mobile-tabbar .tab-label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
  }
  .mobile-tabbar .tab-item:active .tab-icon { transform: scale(0.86); }
  .mobile-tabbar .tab-item.active { color: var(--primary); }
  .mobile-tabbar .tab-item.active .tab-icon {
    color: var(--primary);
    background: var(--primary-light, #dbeafe);
    transform: translateY(-2px) scale(1.06);
    animation: tabIconPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .mobile-tabbar .tab-item.active .tab-label { color: var(--primary); font-weight: 600; }
  @keyframes tabIconPop {
    0% { transform: translateY(0) scale(0.7); }
    62% { transform: translateY(-3px) scale(1.12); }
    100% { transform: translateY(-2px) scale(1.06); }
  }
}
/* 电脑端隐藏底部导航（保留移动端显示） */
@media (min-width: 992px) {
  .mobile-tabbar { display: none; }
}

/* ===== in-frame（登录/注册弹窗 iframe 内）：隐藏顶部+底部导航，内容居中 ===== */
.in-frame .site-header { display: none !important; }
.in-frame .mobile-tabbar { display: none !important; }
.in-frame body { padding-top: 24px; padding-bottom: 24px; }

/* ===== 毛玻璃卡片 ===== */
.release {
  width: 100%;
  max-width: 410px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-inset);
  overflow: hidden;
  animation: cardIn .5s cubic-bezier(.16,1,.3,1);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== 顶部品牌区 ===== */
.release-body .image {
  text-align: center;
  padding: 34px 0 8px;
  background: transparent;
  position: relative;
}
.release-body .image img {
  width: 58px; height: 58px;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb),.25);
  display: block;
  margin: 0 auto;
  border: 2px solid rgba(255,255,255,.60);
}
.release-body .image::after { display: none; }

/* ===== 标题 ===== */
.release-body .title {
  text-align: center;
  padding: 8px 24px 0;
}
.release-body .title h2 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .3px;
  margin: 0 0 14px;
  color: var(--text);
}

/* ===== Tab 切换（胶囊式毛玻璃） ===== */
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,.45);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
  gap: 2px;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: all .25s cubic-bezier(.16,1,.3,1);
  user-select: none;
  cursor: pointer;
}
.auth-tab.active {
  background: rgba(255,255,255,.85);
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.auth-tab:not(.active):hover {
  color: var(--primary);
  background: rgba(255,255,255,.30);
}
.auth-tab a { color: inherit; display: block; }

/* ===== 表单区 ===== */
.block {
  padding: 0 28px 28px;
}
.block-title {
  text-align: center;
  padding: 0 0 12px;
}
.block-title h2 {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
  margin: 0;
}
.block-options { display: none; }

/* ===== 输入框组（毛玻璃） ===== */
.input-group {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.55);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .22s ease;
  margin-bottom: 14px;
}
.input-group:focus-within {
  border-color: var(--primary);
  background: rgba(255,255,255,.80);
  box-shadow: 0 0 0 4px var(--primary-light);
}
/* 警告/错误状态 */
.input-group.is-error {
  border-color: var(--danger) !important;
  background: rgba(239,68,68,.06) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.10) !important;
  animation: shake .35s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.input-group-addon {
  border: none !important;
  background: transparent !important;
  color: var(--text-3);
  padding: 0 0 0 15px;
  width: auto;
  font-size: 16px;
  line-height: 0;
}
.input-group .form-control {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  flex: 1;
  padding: 13px 14px;
  font-size: 15px;
  height: auto;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.input-group .form-control::placeholder { color: var(--text-3); }

/* ===== 密码显隐按钮 ===== */
.pwd-toggle {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  padding: 0 15px;
  height: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.pwd-toggle:hover { color: var(--primary); }
.pwd-toggle.show { color: var(--primary); }
.pwd-toggle .ic-svg { width: 18px; height: 18px; }

/* ===== 复选框（自定义毛玻璃风） ===== */
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 16px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.auth-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 5px;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  position: relative;
  transition: all .2s;
  flex-shrink: 0;
}
.auth-check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: var(--primary);
}
.auth-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ===== 主按钮（渐变 + 光泽扫过） ===== */
.btn-block { border-radius: var(--radius); }

/* 通栏主按钮（登录/注册提交、绑定等） */
.btn-primary.btn-block,
.btn-block.btn-danger {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border: none !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  letter-spacing: 1.5px;
  box-shadow: 0 6px 20px -6px var(--primary-glow);
  transition: all .25s;
  cursor: pointer;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.btn-primary.btn-block::before,
.btn-block.btn-danger::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transition: left .5s;
}
.btn-primary.btn-block:hover::before,
.btn-block.btn-danger:hover::before {
  left: 100%;
}
.btn-primary.btn-block:hover,
.btn-block.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -8px var(--primary-glow);
}
.btn-primary.btn-block:active,
.btn-block.btn-danger:active {
  transform: translateY(0) scale(.98);
}

/* ===== 辅助按钮（胶囊轮廓） ===== */
.btn-rounded {
  display: inline-block;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: rgba(255,255,255,.50) !important;
  color: var(--text-2) !important;
  transition: all .22s;
  cursor: pointer;
}
.btn-rounded:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: rgba(var(--primary-rgb),.08) !important;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb),.12);
  transform: translateY(-1px);
}
.ic-svg {
  display: inline-block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== 分割线（毛玻璃渐变线） ===== */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 16px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ===== 社交登录 ===== */
.qsso-label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
  text-align: center;
}
.qsso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 46px; height: 46px;
  background: rgba(255,255,255,.60);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(var(--primary-rgb),.10);
  transition: all .25s cubic-bezier(.16,1,.3,1);
}
.qsso-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 10px 28px rgba(var(--primary-rgb),.20);
  border-color: var(--primary);
}
.qsso-img { width: 46px; height: 46px; border-radius: 50%; display: block; }
.qsso-btn .ic-svg { width: 22px; height: 22px; }
.qsso-qq { color: #12B7F5; }
.qsso-wx { color: #07C160; }

/* ===== 密码强度条 ===== */
.pmeter { display: flex; align-items: center; gap: 10px; margin: -4px 6px 14px; }
.pmeter.hide { display: none; }
.p-segs { display: flex; gap: 6px; flex: 1; }
.p-segs span { height: 4px; flex: 1; border-radius: 3px; background: var(--border); transition: background .25s; }
.p-segs span.on1 { background: var(--danger); }
.p-segs span.on2 { background: var(--warn); }
.p-segs span.on3 { background: var(--success); }
.p-label { font-size: 12px; color: var(--text-3); white-space: nowrap; font-weight: 500; }
.p-label.w1 { color: var(--danger); }
.p-label.w2 { color: var(--warn); }
.p-label.w3 { color: var(--success); }

/* ===== 验证码加载动画 ===== */
#captcha { text-align: center; margin-bottom: 14px; min-height: 40px; }
#captcha_text { font-size: 13px; color: var(--text-3); }
#captcha_wait { display: flex; justify-content: center; align-items: center; padding: 10px; }
.loading { display: flex; gap: 6px; }
.loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.loading-dot:nth-child(2) { animation-delay: .15s; }
.loading-dot:nth-child(3) { animation-delay: .30s; }
.loading-dot:nth-child(4) { animation-delay: .45s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(.5); opacity: .4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ===== 提示框（毛玻璃） ===== */
.alert-info {
  background: var(--primary-light) !important;
  border: 1px solid rgba(var(--primary-rgb),.18) !important;
  color: var(--primary-dark) !important;
  border-radius: var(--radius) !important;
  font-size: 13px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== 弹窗提示 ===== */
#loginload { color: var(--primary) !important; }

/* ===== Bootstrap 工具类替代 — 不加载 Bootstrap CSS 也能正常显示 ===== */
.form-group { margin-bottom: 15px; }
.text-center { text-align: center; }
.pull-right { float: right; }
.btn {
  display: inline-block;
  margin-bottom: 0;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  background-image: none;
  border: 1px solid transparent;
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  transition: all .22s;
  text-decoration: none;
}
.btn:hover, .btn:focus { text-decoration: none; }
.btn-info { color: var(--primary); background: var(--primary-light); border-color: transparent; }
.btn-default { color: var(--text-2); background: rgba(255,255,255,.50); border-color: var(--border); }
.btn-block {
  display: block;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}
.input-lg { height: 46px; padding: 10px 16px; font-size: 16px; }
.input-group-addon {
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.input-group-addon img { border-radius: 0 var(--radius) var(--radius) 0; }
