/* ==========================================================================
   FubiIP 全站统一认证组件弹窗样式 (scoped to .fubi-auth-*)
   零外部依赖 · 严禁污染各站现有 .modal / .btn / form 全局样式 · 日夜双模自适应
   ========================================================================== */

.fubi-auth-mask,
.fubi-auth-mask *,
.fubi-auth-mask *::before,
.fubi-auth-mask *::after {
  box-sizing: border-box;
}

.fubi-auth-mask {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fubi-auth-mask.is-open {
  opacity: 1;
}

.fubi-auth-mask[hidden] {
  display: none !important;
}

.fubi-auth-modal {
  width: 100%;
  max-width: 428px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 2px;
  box-shadow: 0 24px 56px -12px rgba(15, 23, 42, 0.28), 0 4px 12px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px) scale(0.985);
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fubi-auth-mask.is-open .fubi-auth-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fubi-auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.fubi-auth-head-main {
  min-width: 0;
  flex: 1;
}

.fubi-auth-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.fubi-auth-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: -4px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.fubi-auth-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.fubi-auth-close:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 1px;
}

.fubi-auth-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.fubi-auth-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
}

.fubi-auth-google-btn {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.fubi-auth-google-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.fubi-auth-google-btn:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

.fubi-auth-google-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.fubi-auth-google-ico {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 18px;
}

.fubi-auth-google-txt {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.fubi-auth-notice {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.5;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.fubi-auth-notice[hidden] {
  display: none !important;
}

.fubi-auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0 13px;
  font-size: 12px;
  color: #64748b;
}

.fubi-auth-divider::before,
.fubi-auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.fubi-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  margin-bottom: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
}

.fubi-auth-tab {
  height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 150ms cubic-bezier(0.22, 1, 0.36, 1), color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fubi-auth-tab:hover {
  color: #0f172a;
}

.fubi-auth-tab:active {
  transform: scale(0.985);
}

.fubi-auth-tab[aria-selected="true"] {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.fubi-auth-form:not([hidden]) {
  animation: fubiAuthTabIn 150ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fubiAuthTabIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fubi-auth-form[hidden] {
  display: none !important;
}

.fubi-auth-field {
  margin-bottom: 11px;
}

.fubi-auth-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.fubi-auth-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}

.fubi-auth-field-head .fubi-auth-label {
  margin-bottom: 0;
}

.fubi-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.fubi-auth-input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.fubi-auth-input-wrap .fubi-auth-input {
  padding-right: 38px;
}

.fubi-auth-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.14);
}

.fubi-auth-input:-webkit-autofill,
.fubi-auth-input:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
  transition: background-color 9999s ease-out 0s;
}

.fubi-auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 3px rgba(249, 115, 22, 0.14);
  -webkit-text-fill-color: #0f172a;
  caret-color: #0f172a;
}

.fubi-auth-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.fubi-auth-eye:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.fubi-auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}

.fubi-auth-code-btn {
  height: 38px;
  padding: 0 12px;
  min-width: 104px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease;
}

.fubi-auth-code-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.fubi-auth-code-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fubi-auth-msg {
  margin: 0 0 11px;
  padding: 8px 10px;
  border-radius: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.fubi-auth-msg.is-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.fubi-auth-msg.is-info {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.fubi-auth-msg[hidden] {
  display: none !important;
}

.fubi-auth-submit {
  width: 100%;
  height: 40px;
  margin-top: 2px;
  padding: 0 16px;
  border: none;
  border-radius: 3px;
  background: #f97316;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.14s ease, opacity 0.14s ease;
}

.fubi-auth-submit:hover:not(:disabled) {
  background: #ea580c;
}

.fubi-auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.fubi-auth-link {
  border: none;
  padding: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}

.fubi-auth-link:hover {
  color: #f97316;
  text-decoration: underline;
}

.fubi-auth-forgot-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.55;
  color: #475569;
}

.fubi-auth-forgot-box[hidden] {
  display: none !important;
}

.fubi-auth-reset-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.fubi-auth-reset-btn {
  height: 36px;
  margin-top: 4px;
  font-size: 13px;
}

.fubi-auth-reset-tip {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #64748b;
}

.fubi-auth-foot {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: #64748b;
}

.fubi-auth-foot button {
  border: none;
  padding: 0;
  background: transparent;
  color: #ea580c;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}

.fubi-auth-foot button:hover {
  text-decoration: underline;
}

/* ==================== 夜间深色模式适配 ==================== */
html[data-theme="dark"] .fubi-auth-modal,
[data-theme="dark"] .fubi-auth-modal,
body.dark .fubi-auth-modal,
body.theme-dark .fubi-auth-modal {
  background: #141923;
  color: #f1f5f9;
  border-color: #273244;
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .fubi-auth-head,
[data-theme="dark"] .fubi-auth-head,
body.dark .fubi-auth-head,
body.theme-dark .fubi-auth-head {
  border-bottom-color: #212a3a;
}

html[data-theme="dark"] .fubi-auth-title,
[data-theme="dark"] .fubi-auth-title,
body.dark .fubi-auth-title,
body.theme-dark .fubi-auth-title {
  color: #f8fafc;
}

html[data-theme="dark"] .fubi-auth-close,
[data-theme="dark"] .fubi-auth-close,
body.dark .fubi-auth-close,
body.theme-dark .fubi-auth-close {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-auth-close:hover,
[data-theme="dark"] .fubi-auth-close:hover,
body.dark .fubi-auth-close:hover,
body.theme-dark .fubi-auth-close:hover {
  background: #232d3f;
  color: #f8fafc;
}

html[data-theme="dark"] .fubi-auth-sub,
[data-theme="dark"] .fubi-auth-sub,
body.dark .fubi-auth-sub,
body.theme-dark .fubi-auth-sub,
html[data-theme="dark"] .fubi-auth-divider,
[data-theme="dark"] .fubi-auth-divider,
body.dark .fubi-auth-divider,
body.theme-dark .fubi-auth-divider,
html[data-theme="dark"] .fubi-auth-foot,
[data-theme="dark"] .fubi-auth-foot,
body.dark .fubi-auth-foot,
body.theme-dark .fubi-auth-foot {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-auth-google-btn,
[data-theme="dark"] .fubi-auth-google-btn,
body.dark .fubi-auth-google-btn,
body.theme-dark .fubi-auth-google-btn {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

html[data-theme="dark"] .fubi-auth-google-btn:hover,
[data-theme="dark"] .fubi-auth-google-btn:hover,
body.dark .fubi-auth-google-btn:hover,
body.theme-dark .fubi-auth-google-btn:hover {
  background: #273549;
  border-color: #475569;
}

html[data-theme="dark"] .fubi-auth-notice,
[data-theme="dark"] .fubi-auth-notice,
body.dark .fubi-auth-notice,
body.theme-dark .fubi-auth-notice {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.35);
  color: #fdba74;
}

html[data-theme="dark"] .fubi-auth-divider::before,
html[data-theme="dark"] .fubi-auth-divider::after,
[data-theme="dark"] .fubi-auth-divider::before,
[data-theme="dark"] .fubi-auth-divider::after,
body.dark .fubi-auth-divider::before,
body.dark .fubi-auth-divider::after,
body.theme-dark .fubi-auth-divider::before,
body.theme-dark .fubi-auth-divider::after {
  background: #273244;
}

html[data-theme="dark"] .fubi-auth-tabs,
[data-theme="dark"] .fubi-auth-tabs,
body.dark .fubi-auth-tabs,
body.theme-dark .fubi-auth-tabs {
  background: #0b0f17;
  border-color: #212a3a;
}

html[data-theme="dark"] .fubi-auth-tab,
[data-theme="dark"] .fubi-auth-tab,
body.dark .fubi-auth-tab,
body.theme-dark .fubi-auth-tab {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-auth-tab:hover,
[data-theme="dark"] .fubi-auth-tab:hover,
body.dark .fubi-auth-tab:hover,
body.theme-dark .fubi-auth-tab:hover {
  color: #e2e8f0;
}

html[data-theme="dark"] .fubi-auth-tab[aria-selected="true"],
[data-theme="dark"] .fubi-auth-tab[aria-selected="true"],
body.dark .fubi-auth-tab[aria-selected="true"],
body.theme-dark .fubi-auth-tab[aria-selected="true"] {
  background: #253248;
  color: #ffffff;
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: none;
}

html[data-theme="dark"] .fubi-auth-label,
[data-theme="dark"] .fubi-auth-label,
body.dark .fubi-auth-label,
body.theme-dark .fubi-auth-label {
  color: #cbd5e1;
}

html[data-theme="dark"] .fubi-auth-input,
[data-theme="dark"] .fubi-auth-input,
body.dark .fubi-auth-input,
body.theme-dark .fubi-auth-input {
  background: #0f172a;
  color: #f8fafc;
  border-color: #334155;
}

html[data-theme="dark"] .fubi-auth-input:focus,
[data-theme="dark"] .fubi-auth-input:focus,
body.dark .fubi-auth-input:focus,
body.theme-dark .fubi-auth-input:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.22);
}

html[data-theme="dark"] .fubi-auth-input:-webkit-autofill,
html[data-theme="dark"] .fubi-auth-input:-webkit-autofill:hover,
[data-theme="dark"] .fubi-auth-input:-webkit-autofill,
[data-theme="dark"] .fubi-auth-input:-webkit-autofill:hover,
body.dark .fubi-auth-input:-webkit-autofill,
body.dark .fubi-auth-input:-webkit-autofill:hover,
body.theme-dark .fubi-auth-input:-webkit-autofill,
body.theme-dark .fubi-auth-input:-webkit-autofill:hover {
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset;
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}

html[data-theme="dark"] .fubi-auth-input:-webkit-autofill:focus,
[data-theme="dark"] .fubi-auth-input:-webkit-autofill:focus,
body.dark .fubi-auth-input:-webkit-autofill:focus,
body.theme-dark .fubi-auth-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset, 0 0 0 3px rgba(249, 115, 22, 0.22);
  -webkit-text-fill-color: #f8fafc;
  caret-color: #f8fafc;
}

html[data-theme="dark"] .fubi-auth-eye,
[data-theme="dark"] .fubi-auth-eye,
body.dark .fubi-auth-eye,
body.theme-dark .fubi-auth-eye {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-auth-eye:hover,
[data-theme="dark"] .fubi-auth-eye:hover,
body.dark .fubi-auth-eye:hover,
body.theme-dark .fubi-auth-eye:hover {
  color: #f8fafc;
  background: #1e293b;
}

html[data-theme="dark"] .fubi-auth-code-btn,
[data-theme="dark"] .fubi-auth-code-btn,
body.dark .fubi-auth-code-btn,
body.theme-dark .fubi-auth-code-btn {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

html[data-theme="dark"] .fubi-auth-code-btn:hover:not(:disabled),
[data-theme="dark"] .fubi-auth-code-btn:hover:not(:disabled),
body.dark .fubi-auth-code-btn:hover:not(:disabled),
body.theme-dark .fubi-auth-code-btn:hover:not(:disabled) {
  background: #273549;
  border-color: #475569;
}

html[data-theme="dark"] .fubi-auth-msg,
[data-theme="dark"] .fubi-auth-msg,
body.dark .fubi-auth-msg,
body.theme-dark .fubi-auth-msg {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

html[data-theme="dark"] .fubi-auth-msg.is-ok,
[data-theme="dark"] .fubi-auth-msg.is-ok,
body.dark .fubi-auth-msg.is-ok,
body.theme-dark .fubi-auth-msg.is-ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

html[data-theme="dark"] .fubi-auth-msg.is-info,
[data-theme="dark"] .fubi-auth-msg.is-info,
body.dark .fubi-auth-msg.is-info,
body.theme-dark .fubi-auth-msg.is-info,
html[data-theme="dark"] .fubi-auth-forgot-box,
[data-theme="dark"] .fubi-auth-forgot-box,
body.dark .fubi-auth-forgot-box,
body.theme-dark .fubi-auth-forgot-box {
  background: #0f172a;
  border-color: #273244;
  color: #cbd5e1;
}

html[data-theme="dark"] .fubi-auth-reset-title,
[data-theme="dark"] .fubi-auth-reset-title,
body.dark .fubi-auth-reset-title,
body.theme-dark .fubi-auth-reset-title {
  color: #f8fafc;
}

html[data-theme="dark"] .fubi-auth-reset-tip,
[data-theme="dark"] .fubi-auth-reset-tip,
body.dark .fubi-auth-reset-tip,
body.theme-dark .fubi-auth-reset-tip {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-auth-foot button,
[data-theme="dark"] .fubi-auth-foot button,
body.dark .fubi-auth-foot button,
body.theme-dark .fubi-auth-foot button {
  color: #fb923c;
}

/* ==================== 独立页面用 Google 登录按钮共享样式 ==================== */
.fubi-google-inline-wrap {
  margin-bottom: 14px;
}

.fubi-google-inline-wrap.is-no-divider {
  margin-bottom: 0;
}

.fubi-google-inline-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
}

.fubi-google-inline-divider::before,
.fubi-google-inline-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

html[data-theme="dark"] .fubi-google-inline-divider,
body.dark .fubi-google-inline-divider {
  color: #94a3b8;
}

html[data-theme="dark"] .fubi-google-inline-divider::before,
html[data-theme="dark"] .fubi-google-inline-divider::after,
body.dark .fubi-google-inline-divider::before,
body.dark .fubi-google-inline-divider::after {
  background: #273244;
}

@media (max-width: 420px) {
  .fubi-auth-head {
    padding: 14px 16px 12px;
  }
  .fubi-auth-body {
    padding: 14px 16px 18px;
  }
  .fubi-auth-code-btn {
    min-width: 96px;
    padding: 0 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fubi-auth-mask,
  .fubi-auth-modal,
  .fubi-auth-tab,
  .fubi-auth-google-btn,
  .fubi-auth-submit,
  .fubi-auth-code-btn,
  .fubi-auth-close {
    transition: none !important;
  }
  .fubi-auth-form:not([hidden]) {
    animation: none !important;
  }
}
