/* ============================================================
   登录/注册弹窗 + 滑块验证码 · 独立样式表
   ------------------------------------------------------------
   用途：给「不引用 style.css」的页面使用。
         当前唯一使用方：website/index.html（新版首页）。
         其余 11 个官网页继续走 style.css，本文件不参与。

   来源：style.css 第 2464–2947 行「登录/注册弹窗 — 四面板设计」段。

   作用域：通用类（.form-* / .btn* / .pwd-* / .agree-* / .sms-* /
          .phone-input-wrapper / .country-code-*）一律加 .auth-overlay 前缀，
          避免污染宿主页面同名类。
          .auth-* / .captcha-* / .auth-toast 前缀本身已足够专有，保持原名。

   补齐：首页的按钮规则写作 .nav .nav-actions .btn-primary，
         只作用于导航栏、不作用于弹窗 ⇒ 此处补入弹窗所需的
         .btn / .btn-primary / .btn-block 按钮体系。
         另 style.css 第 2932–2938 行的 .btn-spinner 选择器已丢失
         （只剩悬空的声明体），此处按原样补回，恢复 loading 转圈。

   ⚠️ 契约：本文件与 style.css 的 auth 段是同一套 UI 的两份副本。
         改其中任何一处，必须同步另一处（防止双链路漂移）。
   ============================================================ */

/* ---------- 遮罩 / 弹窗容器 ---------- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(238, 243, 251, 0.78);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
}
.auth-overlay.open { opacity: 1; visibility: visible; }

.auth-modal {
  position: relative;
  width: 440px;
  max-width: 94vw;
  max-height: 90vh;
  overflow: visible;
  background: linear-gradient(168deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.8) 52%, rgba(238,244,255,0.76) 100%);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  padding: 48px 40px 36px;
  box-shadow: 0 34px 90px -18px rgba(15,23,42,0.42), 0 0 0 1px rgba(255,255,255,0.06), inset 0 1px 0 rgba(255,255,255,0.9);
  transform: translateY(20px) scale(0.97);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-overlay.open .auth-modal { transform: translateY(0) scale(1); }
.auth-modal::-webkit-scrollbar { width: 4px; }
.auth-modal::-webkit-scrollbar-track { background: transparent; }
.auth-modal::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

.auth-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  box-shadow: 0 4px 14px -8px rgba(15,23,42,0.4), inset 0 1px 0 rgba(255,255,255,0.8);
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.auth-close:hover { background: #e2e8f0; color: #475569; transform: rotate(90deg); }

/* ---------- 面板 ---------- */
.auth-panel { display: none; }
.auth-panel.active { display: block; }

/* ---------- 面板头部 ---------- */
.auth-panel-header { text-align: center; margin-bottom: 28px; }
.auth-panel-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
}

/* ---------- 按钮体系（补齐：首页无全局 .btn 规则） ---------- */
.auth-overlay .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.auth-overlay .btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59,130,246,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}
.auth-overlay .btn-primary:hover {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  box-shadow: 0 0 30px rgba(59,130,246,0.4), 0 4px 12px rgba(59,130,246,0.3);
  transform: translateY(-2px);
}
.auth-overlay .btn-primary:active { transform: translateY(0); }
.auth-overlay .btn-block { width: 100%; justify-content: center; }

/* ---------- 表单 ---------- */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.auth-overlay .form-group { display: flex; flex-direction: column; gap: 7px; }

.auth-overlay .form-input {
  width: 100%;
  padding: 12px 18px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border: 1.5px solid rgba(255,255,255,0.78);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.05), inset 0 1px 0 rgba(255,255,255,0.7);
  color: #0f172a;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
}
.auth-overlay .form-input:hover { border-color: #cbd5e1; }
.auth-overlay .form-input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.auth-overlay .form-input::placeholder { color: #94a3b8; }

/* 屏蔽浏览器原生密码可见性按钮（避免与自定义 .pwd-toggle 重叠） */
/* Edge / IE */
.auth-overlay .form-input::-ms-reveal,
.auth-overlay .form-input::-ms-clear { display: none !important; }
/* Chrome / Safari */
.auth-overlay input[type="password"]::-webkit-credentials-auto-fill-button,
.auth-overlay input[type="password"]::-webkit-strong-password-auto-fill-button,
.auth-overlay input[type="password"]::-webkit-contacts-auto-fill-button,
.auth-overlay input[type="password"]::-webkit-textfield-decoration-container { display: none !important; }

/* ---------- 表单提示文案（规则提示 / 错误 / 通过） ---------- */
.auth-overlay .form-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.auth-overlay .form-hint[data-state="info"]    { color: #64748b; background: #f8fafc; border-color: #e2e8f0; }
.auth-overlay .form-hint[data-state="error"]   { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.auth-overlay .form-hint[data-state="success"] { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.auth-overlay .form-input.is-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}

/* ---------- 手机号输入（+86 区号） ---------- */
.auth-overlay .phone-input-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.auth-overlay .country-code-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  border: 1.5px solid rgba(255,255,255,0.78);
  border-right: none;
  border-radius: 999px 0 0 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
}
.auth-overlay .country-code-text { line-height: 1; }
.auth-overlay .phone-input-wrapper .form-input {
  border-radius: 0 999px 999px 0;
  border-left: none;
}
.auth-overlay .phone-input-wrapper .form-input:focus {
  border-left: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ---------- 验证码输入行 ---------- */
.auth-overlay .sms-code-row {
  display: flex;
  gap: 10px;
}
.auth-overlay .sms-code-row .form-input { flex: 1; }
.auth-overlay .btn-sms {
  padding: 12px 22px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: none;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.auth-overlay .btn-sms:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
  transform: translateY(-1px);
}
.auth-overlay .btn-sms:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 密码切换 ---------- */
.auth-overlay .pwd-wrapper { position: relative; }
.auth-overlay .pwd-wrapper .form-input { padding-right: 44px; }
.auth-overlay .pwd-toggle {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  background: none;
  border: none;
  border-radius: 50%;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.auth-overlay .pwd-toggle:hover { background: #f1f5f9; color: #64748b; }

/* ---------- 服务协议 ---------- */
.auth-overlay .form-agreement { margin-top: -4px; }
.auth-overlay .agree-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}
.auth-overlay .agree-checkbox input { display: none; }
.auth-overlay .agree-checkmark {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
}
.auth-overlay .agree-checkbox input:checked + .agree-checkmark {
  background: #3b82f6;
  border-color: #3b82f6;
}
.auth-overlay .agree-text { flex: 1; }
.auth-overlay .agree-text a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}
.auth-overlay .agree-text a:hover { text-decoration: underline; }

/* ---------- 提交按钮 ---------- */
.auth-submit {
  margin-top: 6px;
  padding: 14px 24px !important;
  font-size: 15px !important;
  border-radius: 999px !important;
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- TAB 标签栏 ---------- */
.auth-tabs {
  display: flex;
  margin: 24px 0 20px;
  border-bottom: 1.5px solid #f1f5f9;
  gap: 0;
}
.auth-tab {
  flex: 1;
  padding: 10px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}
.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 50%;
  height: 2.5px;
  background: #3b82f6;
  border-radius: 2px;
  transition: all 0.25s ease;
}
.auth-tab.active { color: #3b82f6; }
.auth-tab.active::after { transform: translateX(-50%) scaleX(1); }
.auth-tab:hover { color: #64748b; }
.auth-tab.active:hover { color: #3b82f6; }

.auth-tab-content { display: none; }
.auth-tab-content.active { display: block; }
.auth-tab-content.active .auth-form { margin-top: 6px; }

/* ---------- 切换链接 ---------- */
.auth-switch-links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding: 0 4px;
}
.auth-switch-links a {
  font-size: 13px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.auth-switch-links a:hover { color: #3b82f6; }

/* ---------- Toast ---------- */
.auth-toast {
  position: absolute;
  bottom: -52px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 10;
}
.auth-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.auth-toast.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #16a34a; }
.auth-toast.error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.auth-toast.info { background: #eff6ff; border: 1px solid #bfdbfe; color: #2563eb; }

/* ---------- 滑块验证码 ---------- */
.captcha-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 10001;
  align-items: center; justify-content: center;
}
.captcha-box {
  background: rgba(255,255,255,0.82); border-radius: 20px; padding: 24px;
  border: 1px solid rgba(255,255,255,0.75);
  backdrop-filter: blur(20px) saturate(175%);
  -webkit-backdrop-filter: blur(20px) saturate(175%);
  width: 360px; box-shadow: 0 26px 64px -18px rgba(15,23,42,0.5), inset 0 1px 0 rgba(255,255,255,0.85);
}
.captcha-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; font-size: 15px; font-weight: 600; color: #1a1d29;
}
.captcha-close {
  border: none; background: none; font-size: 20px; cursor: pointer; color: #9ca3b0;
}
.captcha-canvas-wrap {
  width: 300px; height: 160px; margin: 0 auto 16px;
  border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; position: relative;
}
.captcha-slider-wrap { margin-bottom: 12px; }
.captcha-slider-track {
  height: 40px; background: #f1f5f9; border-radius: 20px;
  position: relative; display: flex; align-items: center; justify-content: center;
  user-select: none; overflow: hidden;
}
.captcha-slider-text { font-size: 13px; color: #9ca3b0; }
.captcha-slider-btn {
  position: absolute; left: 0; top: 0; width: 40px; height: 40px;
  background: #2563eb; border-radius: 20px; cursor: grab;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.captcha-slider-btn:active { cursor: grabbing; }
.captcha-actions { text-align: center; }
.captcha-refresh {
  border: none; background: none; font-size: 13px; color: #2563eb; cursor: pointer;
}

/* ---------- loading 转圈（style.css 中该选择器已丢失，此处补回） ---------- */
.auth-overlay .btn-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
  .auth-modal { padding: 40px 28px 28px; border-radius: 22px; }
  .auth-panel-title { font-size: 20px; }
  .auth-overlay .country-code-selector { padding: 0 10px; font-size: 13px; }
}
