/**
 * 登录/注册弹窗：使用主题变量统一亮暗色调。
 */
body.modal-open .modal-backdrop.show {
  opacity: 0.42;
}

.zhanlan-auth-modal {
  --zhanlan-auth-bg: var(--card-bg, #151515);
  --zhanlan-auth-bg-soft: color-mix(in srgb, var(--card-bg-hover, #242424) 62%, var(--card-bg, #151515));
  --zhanlan-auth-text: var(--text-color, #f5f5f5);
  --zhanlan-auth-muted: var(--text-muted, rgba(255, 255, 255, 0.62));
  --zhanlan-auth-border: color-mix(in srgb, var(--border-color, #3a3a3a) 78%, transparent);
  --zhanlan-auth-action-bg: var(--text-color, #fff);
  --zhanlan-auth-action-text: var(--card-bg, #111);
}

body.light-theme .zhanlan-auth-modal,
body.zhanlan-theme-light .zhanlan-auth-modal,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal {
  --zhanlan-auth-bg: #fff;
  --zhanlan-auth-bg-soft: #f8fafc;
  --zhanlan-auth-text: #111827;
  --zhanlan-auth-muted: #64748b;
  --zhanlan-auth-border: #d1d5db;
  --zhanlan-auth-action-bg: #111;
  --zhanlan-auth-action-text: #fff;
}

.zhanlan-auth-modal__dialog {
  width: min(92vw, 320px);
  max-width: min(92vw, 320px);
  margin-left: auto;
  margin-right: auto;
}

.zhanlan-auth-modal__content {
  position: relative;
  overflow: hidden;
  color: var(--zhanlan-auth-text);
  background: var(--zhanlan-auth-bg);
  border: 1px solid var(--zhanlan-auth-border);
  border-radius: 0.55rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28) !important;
}

.zhanlan-auth-modal__logo-wrap {
  max-width: 100%;
  padding-top: 0.65rem !important;
}

.zhanlan-auth-modal__logo {
  display: inline-block;
  width: auto;
  max-width: 108px;
  max-height: 32px;
  object-fit: contain;
}

.zhanlan-auth-modal .modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  height: 36px;
  padding: 0 3rem 0 0.85rem;
  background: var(--zhanlan-auth-bg);
  border-color: var(--zhanlan-auth-border) !important;
}

.zhanlan-auth-modal__tabs {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 0.25rem !important;
  width: auto;
  height: 100%;
  padding: 0;
  margin: 0;
}

.zhanlan-auth-modal__tabs .nav-item {
  flex: 0 0 auto;
  line-height: 1.2;
}

.zhanlan-auth-modal__tabs .nav-link {
  width: auto;
  min-width: 3rem;
  min-height: 1.75rem;
  padding: 0.22rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--zhanlan-auth-text);
  text-align: center;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--zhanlan-auth-border);
  border-radius: 0.32rem;
  box-shadow: none;
  opacity: 1;
}

.zhanlan-auth-modal__tabs .nav-link.active {
  color: var(--zhanlan-auth-action-text);
  background: var(--zhanlan-auth-action-bg);
  border-color: var(--zhanlan-auth-action-bg);
}

.zhanlan-auth-modal .btn-close {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  z-index: 2;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  opacity: 1;
  transform: translateY(-50%);
  background-color: var(--zhanlan-auth-action-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.68rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23111'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 0 1 .293 14.293L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  filter: none;
}

body.light-theme .zhanlan-auth-modal .btn-close,
body.zhanlan-theme-light .zhanlan-auth-modal .btn-close,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .btn-close {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 0 1 .293 14.293L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.zhanlan-auth-modal .modal-body {
  padding: 0.8rem 0.95rem 0.95rem;
}

.zhanlan-auth-modal .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  color: var(--zhanlan-auth-text);
}

.zhanlan-auth-modal .form-control {
  min-height: 0;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.86rem;
  line-height: 1.25;
  color: var(--zhanlan-auth-text);
  background: var(--zhanlan-auth-bg-soft);
  border-color: var(--zhanlan-auth-border);
  border-radius: 0.32rem;
}

.zhanlan-auth-modal .form-control:focus {
  color: var(--zhanlan-auth-text);
  background: var(--zhanlan-auth-bg-soft);
  border-color: var(--zhanlan-auth-action-bg);
  box-shadow: 0 0 0 0.16rem color-mix(in srgb, var(--zhanlan-auth-action-bg) 18%, transparent);
}

.zhanlan-auth-method {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
}

.zhanlan-auth-method .btn {
  width: 100%;
  min-height: 0;
  margin-left: 0 !important;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.86rem;
  line-height: 1.25;
  color: var(--zhanlan-auth-text);
  background: transparent;
  border-color: var(--zhanlan-auth-border);
  border-radius: 0.32rem !important;
  box-shadow: none;
}

.zhanlan-auth-method .btn-outline-secondary.active,
.zhanlan-auth-method .btn-outline-secondary:hover,
.zhanlan-auth-method .btn-outline-secondary:focus {
  color: var(--zhanlan-auth-action-text);
  background: var(--zhanlan-auth-action-bg);
  border-color: var(--zhanlan-auth-action-bg);
  box-shadow: none;
}

.zhanlan-auth-modal .btn-primary,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg {
  min-height: 2.1rem;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--zhanlan-auth-action-text);
  background: var(--zhanlan-auth-action-bg);
  border-color: var(--zhanlan-auth-action-bg);
  border-radius: 0.32rem;
  box-shadow: none;
}

.zhanlan-auth-modal .btn-primary:hover,
.zhanlan-auth-modal .btn-primary:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg:focus {
  color: var(--zhanlan-auth-action-text);
  background: color-mix(in srgb, var(--zhanlan-auth-action-bg) 92%, transparent);
  border-color: var(--zhanlan-auth-action-bg);
}

.zhanlan-auth-modal .input-group .btn {
  min-height: 0;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  font-size: 0.82rem;
  color: var(--zhanlan-auth-text);
  border-color: var(--zhanlan-auth-border);
}

.zhanlan-auth-modal .text-muted {
  color: var(--zhanlan-auth-muted) !important;
}

.zhanlan-auth-oauth-quick {
  border-top: 1px solid var(--zhanlan-auth-border);
}

.zhanlan-auth-oauth-icon {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  background: #111;
  border: 0;
  border-radius: 999px;
}

.zhanlan-auth-oauth-icon img {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
  display: block;
  border-radius: 0;
  background: transparent !important;
}

.zhanlan-auth-oauth-icon:hover,
.zhanlan-auth-oauth-icon:focus {
  background: transparent;
  outline: none;
  opacity: 0.88;
}

body.light-theme .zhanlan-auth-oauth-icon,
body.zhanlan-theme-light .zhanlan-auth-oauth-icon,
html[data-zhanlan-theme="light"] .zhanlan-auth-oauth-icon {
  color: #111;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}
/**
 * 登录/注册弹窗：与主题亮暗色协调，半透明背景
 * 弹窗打开时略降低遮罩不透明度，便于看到背后页面
 */
body.modal-open .modal-backdrop.show {
  opacity: 0.42;
}

.zhanlan-auth-modal__logo-wrap {
  max-width: 100%;
}

.zhanlan-auth-modal__logo {
  max-height: 34px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  display: inline-block;
}

.zhanlan-auth-modal__dialog {
  width: min(92vw, 340px);
  max-width: min(92vw, 340px);
  margin-left: auto;
  margin-right: auto;
}

.zhanlan-auth-modal__content {
  position: relative;
  background: var(--bs-body-bg, #1a1a1a);
  color: var(--bs-body-color, #e8e8e8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.6rem;
}

body.zhanlan-theme-light .zhanlan-auth-modal__content,
body.light-theme .zhanlan-auth-modal__content,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal__content {
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  border-color: rgba(0, 0, 0, 0.1);
}

.zhanlan-auth-modal__tabs {
  display: inline-flex;
  flex-flow: row nowrap;
  gap: 0.35rem !important;
  width: auto;
  height: 100%;
  align-items: center;
  padding-right: 0;
  margin: 0;
}

.zhanlan-auth-modal__tabs .nav-item {
  flex: 0 0 auto;
  line-height: 1.2;
}

.zhanlan-auth-modal__tabs .nav-link {
  width: auto;
  min-width: 4rem;
  border-radius: 0.32rem;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  opacity: 1;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.12rem 0.5rem;
  min-height: 1.45rem;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
}

.zhanlan-auth-modal__tabs .nav-link.active {
  opacity: 1;
  background: #111;
  color: #fff;
  border-color: #111;
}

body.zhanlan-theme-light .zhanlan-auth-modal__tabs .nav-link,
body.light-theme .zhanlan-auth-modal__tabs .nav-link,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal__tabs .nav-link {
  color: #111;
  border-color: rgba(0, 0, 0, 0.35);
}

body.zhanlan-theme-light .zhanlan-auth-modal__tabs .nav-link.active,
body.light-theme .zhanlan-auth-modal__tabs .nav-link.active,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal__tabs .nav-link.active {
  color: #111;
  background: #fff;
  border-color: #111;
}

.zhanlan-auth-modal .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: inherit;
}

body.zhanlan-theme-light .zhanlan-auth-modal .form-control,
body.light-theme .zhanlan-auth-modal .form-control,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .form-control {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

.zhanlan-auth-method .btn-outline-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: inherit;
}

body.zhanlan-theme-light .zhanlan-auth-method .btn-outline-secondary,
body.light-theme .zhanlan-auth-method .btn-outline-secondary,
html[data-zhanlan-theme="light"] .zhanlan-auth-method .btn-outline-secondary {
  border-color: rgba(0, 0, 0, 0.15);
}

.zhanlan-auth-modal .modal-header {
  min-height: 46px;
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0.85rem;
  padding-right: 3rem;
  align-items: center;
  justify-content: flex-start;
  position: relative;
}

.zhanlan-auth-modal .btn-close {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  z-index: 2;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 999px;
  opacity: 1;
  background-color: #111;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 0 1 .293 14.293L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
  background-size: 0.72rem;
  background-position: center;
  background-repeat: no-repeat;
  filter: none;
}

body.zhanlan-theme-light .zhanlan-auth-modal .btn-close,
body.light-theme .zhanlan-auth-modal .btn-close,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .btn-close {
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23111'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293A1 1 0 0 1 .293 14.293L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");
}

.zhanlan-auth-modal .modal-body {
  padding-top: 0.85rem;
}

.zhanlan-auth-modal .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
}

.zhanlan-auth-modal .form-control,
.zhanlan-auth-modal .btn {
  min-height: 0;
  font-size: 0.86rem;
  line-height: 1.25;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
  border-radius: 0.32rem;
}

.zhanlan-auth-method {
  gap: 0.25rem;
}

.zhanlan-auth-method.btn-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.zhanlan-auth-method .btn {
  width: 100%;
  margin-left: 0 !important;
  border-radius: 0.32rem !important;
}

.zhanlan-auth-method .btn-outline-secondary.active,
.zhanlan-auth-method .btn-outline-secondary:hover,
.zhanlan-auth-method .btn-outline-secondary:focus {
  color: #fff;
  background: #111;
  border-color: #111;
  box-shadow: none;
}

body.zhanlan-theme-light .zhanlan-auth-method .btn-outline-secondary.active,
body.zhanlan-theme-light .zhanlan-auth-method .btn-outline-secondary:hover,
body.zhanlan-theme-light .zhanlan-auth-method .btn-outline-secondary:focus,
body.light-theme .zhanlan-auth-method .btn-outline-secondary.active,
body.light-theme .zhanlan-auth-method .btn-outline-secondary:hover,
body.light-theme .zhanlan-auth-method .btn-outline-secondary:focus,
html[data-zhanlan-theme="light"] .zhanlan-auth-method .btn-outline-secondary.active,
html[data-zhanlan-theme="light"] .zhanlan-auth-method .btn-outline-secondary:hover,
html[data-zhanlan-theme="light"] .zhanlan-auth-method .btn-outline-secondary:focus {
  color: #111;
  background: #fff;
  border-color: #111;
}

.zhanlan-auth-modal .btn-primary,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg {
  color: #fff;
  background: #111;
  border-color: #111;
  box-shadow: none;
  font-weight: 600;
  min-height: 2.1rem;
}

.zhanlan-auth-modal .btn-primary:hover,
.zhanlan-auth-modal .btn-primary:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-userpass-login:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-sms-submit:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-email-login:focus,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg:hover,
.zhanlan-auth-modal .zhanlan-auth-btn-email-reg:focus {
  color: #fff;
  background: #000;
  border-color: #000;
}

body.zhanlan-theme-light .zhanlan-auth-modal .btn-primary,
body.zhanlan-theme-light .zhanlan-auth-modal .zhanlan-auth-btn-userpass-login,
body.zhanlan-theme-light .zhanlan-auth-modal .zhanlan-auth-btn-sms-submit,
body.zhanlan-theme-light .zhanlan-auth-modal .zhanlan-auth-btn-email-login,
body.zhanlan-theme-light .zhanlan-auth-modal .zhanlan-auth-btn-email-reg,
body.light-theme .zhanlan-auth-modal .btn-primary,
body.light-theme .zhanlan-auth-modal .zhanlan-auth-btn-userpass-login,
body.light-theme .zhanlan-auth-modal .zhanlan-auth-btn-sms-submit,
body.light-theme .zhanlan-auth-modal .zhanlan-auth-btn-email-login,
body.light-theme .zhanlan-auth-modal .zhanlan-auth-btn-email-reg,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .btn-primary,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .zhanlan-auth-btn-userpass-login,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .zhanlan-auth-btn-sms-submit,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .zhanlan-auth-btn-email-login,
html[data-zhanlan-theme="light"] .zhanlan-auth-modal .zhanlan-auth-btn-email-reg {
  color: #111;
  background: #fff;
  border-color: #111;
}

.zhanlan-auth-oauth-quick {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.zhanlan-theme-light .zhanlan-auth-oauth-quick,
body.light-theme .zhanlan-auth-oauth-quick,
html[data-zhanlan-theme="light"] .zhanlan-auth-oauth-quick {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.zhanlan-auth-oauth-icon {
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
}

.zhanlan-auth-oauth-icon img {
  width: 60px !important;
  height: 60px !important;
  max-width: 60px;
  max-height: 60px;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.zhanlan-auth-oauth-icon:hover,
.zhanlan-auth-oauth-icon:focus {
  color: #fff;
  background: transparent;
  outline: none;
  opacity: 0.88;
}

body.zhanlan-theme-light .zhanlan-auth-oauth-icon,
body.light-theme .zhanlan-auth-oauth-icon,
html[data-zhanlan-theme="light"] .zhanlan-auth-oauth-icon {
  color: #111;
  background: transparent;
  border-color: transparent;
}
