/* ── Header Login Button ────────────────────────────────────── */
.header-login-button {
  padding: 8px 20px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font);
}
.header-login-button:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.7);
}

/* ── Bind Phone Tips Bar ─────────────────────────────────────── */
.header-bind-phone-tips {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--warning);
}
.header-bind-phone-text { flex: 1; }
.header-bind-phone-button {
  padding: 3px 10px;
  border: 1px solid var(--warning);
  border-radius: 6px;
  font-size: 12px;
  color: var(--warning);
  white-space: nowrap;
}

/* ── User Info Menu ──────────────────────────────────────────── */
.login-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.login-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.login-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-popup {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 500;
  width: 260px;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  color: #1e2226;
  opacity: 0;
  pointer-events: none;
  transform: rotateX(90deg);
  transform-origin: top;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.login-popup::before {
  content: "";
  position: absolute;
  top: -10px;
  right: 0;
  width: 100%;
  height: 10px;
}
.login-menu:hover .login-popup,
.login-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: rotateX(0);
}
.login-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-large-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 40px;
  background: #f0eeff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #722aff;
  font-size: 15px;
  font-weight: 700;
}
.login-large-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-info { flex: 1; min-width: 0; }
.login-name {
  font-size: 14px;
  font-weight: 500;
  color: #1e2226;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-mobile {
  font-size: 12px;
  color: #8a9099;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-logout-btn {
  border: 0;
  background: none;
  font-size: 12px;
  color: #8a9099;
  cursor: pointer;
  white-space: nowrap;
  padding: 0;
  flex: 0 0 auto;
}
.login-logout-btn:hover { color: #ef4444; }
.login-logout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Login Dialog Mask ───────────────────────────────────────── */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 1099;
  display: flex;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  animation: loginFadeIn 0.3s forwards;
}
.login-mask.closing {
  animation: loginFadeIn 0.3s reverse ease-in forwards;
}
@keyframes loginFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-container {
  position: relative;
  width: 920px;
  height: 570px;
  margin: auto;
  display: flex;
  border-radius: 36px;
  background-image: url(https://cdn2.weimob.com/saas/saas-fe-sirius-orion-node/production/zh-CN/483/dengluyebeijingtu.png);
  background-size: 100% 100%;
  animation: loginScale 0.3s forwards;
}
.login-mask.closing .login-container {
  animation: loginScale 0.3s reverse ease-in forwards;
}
@keyframes loginScale {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

.login-image-wrapper {
  width: 330px;
  flex: 0 0 330px;
  overflow: hidden;
  border-radius: 36px;
  background-image: url(https://cdn2.weimob.com/saas/saas-fe-sirius-orion-node/production/zh-CN/483/zhuceliyidian.png);
  background-size: 100% 100%;
}

.login-wrapper {
  flex: 1;
  overflow: hidden;
  padding: 20px;
}

.login-box {
  height: 100%;
  background: #f5f7fa;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 36px rgba(0, 0, 0, 0.08);
}

.login-close {
  position: absolute;
  top: -16px;
  right: -36px;
  width: 32px;
  height: 32px;
  border-radius: 32px;
  background-color: rgba(255, 255, 255, 0.3);
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s;
  z-index: 10;
}
.login-close:hover {
  background-color: rgba(255, 255, 255, 0.6);
  color: #333;
}
.login-close img {
  width: 15px;
  height: 15px;
  display: block;
}

.login-type-toggle {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.login-toggle-text {
  align-self: center;
  padding: 8px 16px;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #722aff;
  position: relative;
}
.login-toggle-text::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 7px;
  border-color: transparent transparent transparent #fff;
}
.login-toggle-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  cursor: pointer;
}

.login-form-box {
  display: flex;
  flex-direction: column;
}

.login-qr-box {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 0 95px;
}
.login-qr-title {
  margin: 27px auto 16px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: #3d3d3d;
}
.login-qr-wrap {
  position: relative;
  box-sizing: border-box;
  width: 190px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  justify-content: center;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.login-qr-wrap img {
  width: 160px;
  height: 160px;
  object-fit: contain;
}
.login-qr-expired {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  font-size: 16px;
  color: #3d3d3d;
}
.login-qr-expired:hover {
  color: #722aff;
}
.login-qr-expired svg {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
}
.login-qr-hint {
  display: flex;
  align-items: center;
  margin: 12px auto 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: #8a9099;
}
.login-qr-hint img {
  width: 24px;
  height: 24px;
  margin-right: 7px;
}

.login-form-title {
  margin: 27px auto 36px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: #3d3d3d;
}
.login-tel-row {
  display: flex;
  width: calc(100% - 190px);
  height: 56px;
  align-self: center;
  align-items: center;
  background-color: #fff;
  border-radius: 56px;
  margin: 0 95px 10px;
  overflow: hidden;
}
.login-area-wrap {
  position: relative;
  height: 56px;
  min-width: 92px;
  padding: 0 16px 0 20px;
  border-right: 1px solid #d8d8d8;
  background: #fff;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  cursor: pointer;
}
.login-area-wrap::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 9px;
  margin-top: -4px;
  border-right: 1.5px solid #1e2226;
  border-bottom: 1.5px solid #1e2226;
  transform: rotate(45deg);
}
.login-area-label {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  color: #1e2226;
  white-space: nowrap;
}
.login-area-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  cursor: pointer;
  outline: none;
}
.login-tel-input {
  flex: 1;
  height: 54px;
  border: none;
  background-color: transparent;
  padding: 0 16px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  color: #1e2226;
  outline: none;
  min-width: 0;
}
.login-tel-input::placeholder {
  font-size: 16px;
  font-weight: 400;
  color: #b6babf;
}

.login-btn-primary {
  height: 56px;
  margin: 0 95px;
  border: 0;
  border-radius: 28px;
  background: #722aff;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s;
}
.login-btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.login-btn-primary:not(:disabled):hover {
  background: #8066ff;
}

.login-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -14px 90px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b6babf;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}
.login-back-btn:hover {
  color: #1e2226;
}
.login-otp-tip {
  margin: 0 90px;
  color: #626973;
  font-size: 16px;
  line-height: 24px;
}
.login-otp-tip.error {
  color: #ff5959;
  font-size: 14px;
}
.login-otp-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  margin: 20px 90px;
}
.login-otp-native {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  color: transparent;
  caret-color: transparent;
  background: transparent;
  outline: none;
}
.login-otp-slot {
  position: relative;
  width: 46px;
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  background: #fff;
  color: #1e2226;
  font-size: 24px;
  font-weight: 500;
  transition: border-color 0.2s ease;
}
.login-otp-slot.active {
  border-color: rgb(115, 59, 229);
}
.login-otp-slot.error {
  border-color: #ff5959;
}
.login-otp-fake-caret-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: login-caret-blink 1.2s ease-out infinite;
}
.login-otp-fake-caret {
  width: 1px;
  height: 24px;
  background: #1e2226;
}
@keyframes login-caret-blink {
  0%,
  70%,
  100% {
    opacity: 1;
  }
  20%,
  50% {
    opacity: 0;
  }
}
.login-otp-resend,
.login-otp-countdown {
  align-self: flex-start;
  margin: 0 90px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #722aff;
  font-size: 16px;
  line-height: 24px;
}
.login-otp-resend {
  cursor: pointer;
}
.login-otp-resend:hover {
  color: #8066ff;
}
.login-otp-countdown {
  color: #626973;
}

.login-agreement {
  align-self: center;
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  color: #8a9099;
  text-align: center;
}
.login-agreement button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8a9099;
  font: inherit;
  cursor: pointer;
}
.login-agreement button:hover {
  color: #002b66;
}

@media (max-width: 980px) {
  .login-container {
    width: min(920px, calc(100vw - 40px));
  }
  .login-close {
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.18);
  }
}

@media (max-width: 760px) {
  .login-container {
    width: calc(100vw - 28px);
    height: auto;
    min-height: 560px;
  }
  .login-image-wrapper {
    display: none;
  }
  .login-wrapper {
    padding: 16px;
  }
  .login-qr-box,
  .login-form-box {
    padding: 0;
  }
  .login-tel-row,
  .login-btn-primary,
  .login-back-btn,
  .login-otp-tip,
  .login-otp-row,
  .login-otp-resend,
  .login-otp-countdown {
    margin-left: 28px;
    margin-right: 28px;
  }
  .login-tel-row {
    width: auto;
  }
}
