/* Candy #page 内登录：固定高度，禁止上下滑动；背景与历史版一致 #0a0e16 */
body.on-login .page-container,
body.on-login .page-container-article {
  background: #0a0e16 !important;
}
body.on-login > .bg#site-bg {
  opacity: 0 !important;
  visibility: hidden !important;
}
body.on-login #page,
body.on-login #page.page {
  background: #0a0e16 !important;
}
.page-container .login-shell.article-shell,
.page-container-article .login-shell {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #0a0e16 !important;
  z-index: 2;
}
.page-container .login-shell .login-scroll,
.page-container-article .login-shell .login-scroll {
  width: 420px;
  max-width: min(420px, calc(100vw - 40px));
  height: auto;
  max-height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  margin: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 16px;
  box-sizing: border-box;
  background: #0a0e16;
}
.login-shell .gate-embed-card.tech-card {
  width: 100%;
  height: auto;
  max-width: none;
  min-height: 0;
  max-height: none;
  margin: 0;
  opacity: 1;
  transform: none;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: inherit;
  position: relative;
  background: #0a0e16 !important;
  backdrop-filter: none !important;
}
.login-shell .gate-embed-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 8px;
  background: rgba(4, 16, 24, 0.72);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.login-shell .gate-embed-close:hover {
  color: #041018;
  background: linear-gradient(90deg, #00f0ff, #00b8d4);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
}
.login-shell .gate-embed-close:focus-visible {
  outline: 2px solid var(--primary-color, #00f0ff);
  outline-offset: 2px;
}
.login-shell .card-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 18px 20px 16px !important;
  box-sizing: border-box;
}
.login-shell .card-footer {
  display: none !important;
}
.login-shell .gate-register-to-login {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--primary-color, #00f0ff);
  text-decoration: none;
}
.login-shell .gate-register-to-login:hover {
  color: #fff;
}
/* 微信 / 账号 Tab 叠放，高度取较高者；未激活层必须不绘制，避免切换漏层 */
.login-shell .gate-tab-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  flex: 0 0 auto;
  min-height: 0;
  isolation: isolate;
  position: relative;
  overflow: hidden;
}
.login-shell .gate-tab-stack > .gate-tab-panel,
.login-shell .gate-tab-stack > .gate-tab-panel.is-active,
.login-shell .gate-tab-stack > .gate-tab-panel[hidden] {
  grid-area: 1 / 1;
  display: flex !important;
  flex-direction: column !important;
  align-self: stretch;
  width: 100%;
  min-height: 0;
  height: auto;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  position: relative;
}
.login-shell .gate-tab-stack > .gate-tab-panel.is-active {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
  z-index: 1;
}
.login-shell .gate-tab-stack > .gate-tab-panel:not(.is-active),
.login-shell .gate-tab-stack > .gate-tab-panel:not(.is-active) * {
  visibility: hidden !important;
  pointer-events: none !important;
}
.login-shell .gate-wx-panel {
  flex: 0 0 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 !important;
  overflow: hidden;
  gap: 0;
}
/* 第三方登录紧贴确认按钮 */
.login-shell .gate-wx-panel > .gate-oauth-section {
  flex: 0 0 auto;
  width: 100%;
  margin: 10px 0 0 !important;
  padding: 0;
}
.login-shell .gate-wx-panel > .gate-oauth-section .gate-oauth-divider {
  margin-bottom: 8px;
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.65);
}
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-qr {
  width: 200px !important;
  height: 200px !important;
  margin: 0 auto 10px !important;
  padding: 8px !important;
  flex: 0 0 auto;
}
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-code-box {
  margin-bottom: 8px !important;
  padding: 10px !important;
}
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-code {
  font-size: 28px !important;
  letter-spacing: 0.2em !important;
}
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-steps,
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-status {
  margin-bottom: 8px !important;
  font-size: 12px !important;
}
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-btn,
.login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-jump {
  height: 40px !important;
  min-height: 40px !important;
}
/* gate-toast removed — use CandyUI.notify */

/* 账号登录：铺满与微信同高的叠层，底部内容贴底 */
.login-shell .gate-tab-panel[data-panel="account"] {
  justify-content: flex-start;
}
.login-shell .gate-tab-panel[data-panel="account"] .login-form {
  flex: 0 0 auto;
}
.login-shell .gate-account-head {
  margin: 0 0 14px;
  text-align: left;
  flex: 0 0 auto;
}
.login-shell .gate-account-head-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1.3;
}
.login-shell .gate-account-head-desc {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
.login-shell .gate-account-extra {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  min-height: 0;
}
.login-shell .gate-account-mid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-shell .gate-account-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.login-shell .gate-account-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.login-shell .gate-feat-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  background: rgba(0, 240, 255, 0.06);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.04em;
}
.login-shell .gate-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.08);
  color: var(--primary-color, #00f0ff);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.login-shell .gate-register-btn:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: rgba(0, 240, 255, 0.55);
  color: #fff;
}
.login-shell .gate-account-tips {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.18);
  background: rgba(0, 240, 255, 0.05);
}
.login-shell .gate-account-tip-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.login-shell .gate-forgot-link {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--primary-color, #00f0ff);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 240, 255, 0.45);
}
.login-shell .gate-forgot-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}
.login-shell .gate-account-extra .gate-oauth-section {
  margin: 0 !important;
}
.login-shell .gate-account-extra .gate-oauth-divider {
  margin-bottom: 10px;
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.65);
}
.login-shell .gate-sys-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 240, 255, 0.16);
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.04), rgba(123, 44, 191, 0.06));
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(0, 240, 255, 0.72);
  font-family: var(--candy-font-mono, ui-monospace, Consolas, monospace);
  user-select: none;
}
.login-shell .gate-sys-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7bed9f;
  box-shadow: 0 0 8px rgba(123, 237, 159, 0.8);
  animation: gate-sys-pulse 1.8s ease-in-out infinite;
}
.login-shell .gate-sys-sep {
  opacity: 0.4;
}
@keyframes gate-sys-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* 压缩微信区间距，保证一屏内 */
.login-shell .gate-login-tabs {
  flex: 0 0 auto;
  margin: 0 34px 12px 0 !important;
}
.login-shell .gate-wx-qr {
  width: 180px !important;
  height: 180px !important;
  padding: 8px !important;
  margin: 0 auto 10px !important;
  border-radius: 12px !important;
  flex-shrink: 0;
}
.login-shell .gate-wx-code-box {
  width: 100%;
  margin: 0 0 8px !important;
  padding: 10px 10px !important;
  flex-shrink: 0;
}
.login-shell .gate-wx-code {
  font-size: 28px !important;
  letter-spacing: 0.22em !important;
}
.login-shell .gate-wx-code-label {
  font-size: 11px !important;
  margin-bottom: 4px !important;
}
.login-shell .gate-wx-steps {
  margin-bottom: 8px !important;
  font-size: 12px !important;
  flex-shrink: 0;
}
.login-shell .gate-wx-tip {
  width: 100%;
  margin: 0 0 8px !important;
  font-size: 13px !important;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88) !important;
  text-align: center;
  line-height: 1.5;
  flex-shrink: 0;
}
.login-shell .gate-wx-status {
  margin-bottom: 8px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.login-shell .gate-wx-btn,
.login-shell .gate-wx-jump {
  flex-shrink: 0;
  height: 40px !important;
  min-height: 40px !important;
}
.login-shell .submit-button {
  flex-shrink: 0;
  height: 44px !important;
  min-height: 44px !important;
  background: linear-gradient(90deg, #00f0ff, #00b8d4) !important;
  color: #041018 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(0, 240, 255, 0.55) !important;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.25),
    0 0 24px rgba(0, 240, 255, 0.45) !important;
  text-transform: none !important;
  letter-spacing: 0.04em !important;
}
.login-shell .submit-button:hover {
  border-color: rgba(0, 240, 255, 0.85) !important;
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.45),
    0 0 32px rgba(0, 240, 255, 0.65) !important;
}
.login-shell #gateWxForm {
  width: 100%;
  flex-shrink: 0;
}

/* PC */
@media (min-width: 992px) {
  .page-container .login-shell .login-scroll,
  .page-container-article .login-shell .login-scroll {
    width: 440px;
    max-width: min(440px, calc(100vw - 64px));
    height: auto;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    border-radius: 18px;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .login-shell .card-body {
    padding: 20px 24px 18px !important;
  }
  .login-shell .gate-login-tab {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
  }
  .login-shell .gate-wx-qr {
    width: 200px !important;
    height: 200px !important;
    margin-bottom: 12px !important;
  }
  .login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-qr {
    width: 210px !important;
    height: 210px !important;
    margin-bottom: 10px !important;
  }
  .login-shell .gate-wx-code {
    font-size: 30px !important;
  }
  .login-shell .form-input {
    height: 40px;
  }
  .login-shell .submit-button {
    height: 40px;
    min-height: 40px;
  }
  .login-shell .form-group {
    margin-bottom: 12px !important;
  }
  .login-shell .form-options {
    margin: 2px 0 12px !important;
  }
}

/* 手机：全屏，表单在卡片内滚动 */
@media (max-width: 991px) {
  body.on-login {
    overflow: hidden !important;
  }
  body.on-login #page,
  body.on-login #page.page {
    overflow: hidden !important;
  }
  body.on-login .page-container,
  body.on-login .page-container-article {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    height: var(--candy-vh, 100dvh) !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  body.on-login .page-container .login-shell.article-shell,
  body.on-login .page-container-article .login-shell,
  body.article-place-left.on-login .login-shell.article-shell,
  body.article-place-middle.on-login .login-shell.article-shell,
  body.article-place-right.on-login .login-shell.article-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    height: var(--candy-vh, 100dvh) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    overflow: hidden !important;
    background: #0a0e16 !important;
    z-index: 40 !important;
    box-sizing: border-box !important;
  }

  body.on-login .login-shell .login-scroll {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #0a0e16 !important;
  }

  body.on-login .login-shell .gate-embed-card.tech-card {
    height: 100% !important;
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    background: #0a0e16 !important;
  }
  body.on-login .login-shell .gate-embed-card.tech-card::before,
  body.on-login .login-shell .corner-decoration {
    display: none !important;
  }

  body.on-login .login-shell .card-body {
    padding: 14px 16px 20px !important;
    overflow: visible !important;
  }
  body.on-login .login-shell .gate-embed-close {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
  }

  body.on-login .login-shell .gate-login-tabs {
    margin: 0 40px 10px 0 !important;
  }
  body.on-login .login-shell .gate-login-tab {
    min-height: 42px !important;
    height: 42px !important;
    line-height: 42px !important;
    padding: 0 8px !important;
    font-size: 14px !important;
  }
  body.on-login .login-shell .gate-wx-qr {
    width: min(180px, 42vw) !important;
    height: min(180px, 42vw) !important;
    margin-bottom: 8px !important;
    padding: 8px !important;
  }
  body.on-login .login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-qr {
    width: min(168px, 44vw) !important;
    height: min(168px, 44vw) !important;
    margin-bottom: 8px !important;
    padding: 6px !important;
  }
  body.on-login .login-shell .gate-wx-panel:has(> .gate-oauth-section) .gate-wx-code {
    font-size: 24px !important;
  }
  body.on-login .login-shell .gate-wx-panel > .gate-oauth-section {
    margin-top: 8px !important;
  }
  body.on-login .login-shell .gate-wx-panel > .gate-oauth-section .gate-oauth-divider {
    margin-bottom: 8px;
  }
  body.on-login .login-shell .gate-wx-code {
    font-size: 26px !important;
  }
  body.on-login .login-shell .gate-wx-code-box {
    padding: 8px !important;
    margin-bottom: 6px !important;
  }
  body.on-login .login-shell .gate-wx-steps {
    margin-bottom: 6px !important;
    font-size: 12px !important;
  }
  body.on-login .login-shell .gate-wx-status {
    margin-bottom: 6px !important;
    padding: 6px 8px !important;
  }
  body.on-login .login-shell .gate-wx-btn,
  body.on-login .login-shell .gate-wx-jump,
  body.on-login .login-shell .submit-button {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 15px !important;
  }
  body.on-login .login-shell .form-input,
  body.on-login .login-shell input.form-input {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 16px !important;
  }
  body.on-login .login-shell .form-group {
    margin-bottom: 10px !important;
  }
  body.on-login .login-shell .form-options {
    margin: 0 0 10px !important;
    min-height: 36px;
  }
}
