/* 顶栏登录 */
.header-auth { position: relative; }
.header-login-link {
  font-size: clamp(13px, 0.8vw, 15px);
  color: var(--text-secondary, #9090b0);
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
  user-select: none;
}
.header-login-link:hover { color: var(--gold, #e8c820); }
.header-auth--on { display: block; }
.header-avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: 0.2s;
}
.header-avatar-wrap:hover,
.header-avatar-wrap.is-open { background: rgba(255, 255, 255, 0.06); }
.header-avatar-wrap img {
  width: clamp(34px, 2.4vw, 38px);
  height: clamp(34px, 2.4vw, 38px);
  border-radius: 50%;
  object-fit: cover;
  background: #151d2e;
  display: block;
}
.header-avatar-arrow { font-size: 11px; color: #55556a; }
.header-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 120px;
  background: #151d2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 120;
}
.header-user-menu.is-open { display: block; }
.header-user-menu a {
  display: block;
  padding: 11px 16px;
  font-size: 13px;
  color: #f0f0f5;
  transition: 0.15s;
  white-space: nowrap;
}
.header-user-menu a:hover { background: #19243a; color: var(--gold, #e8c820); }

/* 登录弹层 — 深色情报主题 */
body.auth-modal-open {
  overflow: hidden;
  max-width: 100%;
}

.login_bg_mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.login_bg_mask.is-open { display: block; }

.login_form_con {
  display: none;
  position: fixed;
  z-index: 2001;
  box-sizing: border-box;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #151d2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0f0f5;
  -webkit-overflow-scrolling: touch;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.login_form_con.is-open { display: block; }

.login_form_close_img {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  color: #9090b0;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 2;
}
.login_form_close_img:hover { color: #f0f0f5; background: rgba(255, 255, 255, 0.08); }

.login_form_top {
  padding: 32px 24px 16px;
  box-sizing: border-box;
}

.login_form_title h3 {
  font-size: 20px;
  font-weight: 700;
  color: #f0f0f5;
  margin: 0;
  text-align: left;
  letter-spacing: 0.02em;
}

.login_form_left {
  padding: 0 24px 24px;
  box-sizing: border-box;
  max-width: 100%;
}

.login_form_input {
  width: 100%;
  max-width: 100%;
  margin-bottom: 14px;
  position: relative;
  box-sizing: border-box;
}

.login_form_input input {
  width: 100%;
  max-width: 100%;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 16px;
  padding: 0 14px;
  border-radius: 12px;
  box-sizing: border-box;
  color: #f0f0f5;
  background: #0e1624;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.login_form_input input::placeholder { color: #55556a; }
.login_form_input input:focus {
  outline: none;
  border-color: rgba(232, 200, 32, 0.45);
  box-shadow: 0 0 0 3px rgba(232, 200, 32, 0.1);
}

.login_form_phonenum input { padding-left: 68px; }

.login_form_areacode {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 54px;
  height: 46px;
  font-size: 15px;
  color: #9090b0;
  line-height: 46px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 11px 0 0 11px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.login_form_code {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.login_form_code input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
}

.login_form_verify {
  flex: 0 0 auto;
  position: static;
  height: 48px;
  padding: 0 10px;
  border: none;
  border-radius: 12px;
  background: rgba(232, 200, 32, 0.1);
  color: #e8c820;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  max-width: 34%;
}
.login_form_verify:disabled {
  color: #55556a;
  background: rgba(255, 255, 255, 0.04);
  cursor: not-allowed;
}

.login_form_forget_con {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}
.login_form_forget_con .light_grey,
.login_form_forget {
  color: #9090b0;
  cursor: pointer;
  white-space: nowrap;
}
.login_form_forget_con .light_grey:hover,
.login_form_forget:hover { color: #e8c820; }

.login_form_btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 48px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1035;
  background: linear-gradient(135deg, #fbbf24, #e8c820);
  text-align: center;
  line-height: 48px;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 999px;
  margin-top: 6px;
  transition: opacity 0.18s ease, transform 0.12s ease;
}
.login_form_btn:active { opacity: 0.88; transform: scale(0.99); }

.login_form_left_bottom {
  margin-top: 20px;
  max-width: 100%;
}
.login_form_third_title {
  font-size: 13px;
  color: #55556a;
  margin-bottom: 12px;
}
.login_form_third_pic {
  display: flex;
  align-items: center;
}
.login-wechat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(7, 193, 96, 0.12);
  border: 1px solid rgba(7, 193, 96, 0.28);
}
.login-wechat-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.login-policy {
  margin-top: 16px;
  font-size: 12px;
  color: #55556a;
  line-height: 1.65;
  word-break: break-word;
}
.login-policy a {
  color: #9090b0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.login-policy a:hover { color: #e8c820; }

.login_form_back {
  cursor: pointer;
  padding: 12px 24px 0;
  font-size: 14px;
  color: #9090b0;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}
.login_form_back:hover { color: #e8c820; }

.auth-toast {
  position: fixed;
  top: max(72px, calc(env(safe-area-inset-top, 0px) + 56px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  background: rgba(21, 29, 46, 0.96);
  color: #f0f0f5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: none;
  max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-toast.is-show { display: block; }

.auth-logout-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(4, 8, 16, 0.72);
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.auth-logout-modal.is-open { display: flex; }
.auth-logout-dialog {
  width: min(360px, 100%);
  background: #151d2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px 24px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}
.auth-logout-dialog p {
  font-size: 15px;
  color: #f0f0f5;
  line-height: 1.6;
  margin-bottom: 20px;
}
.auth-logout-actions { display: flex; justify-content: flex-end; gap: 12px; }
.auth-logout-actions button {
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.auth-logout-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: #9090b0;
}
.auth-logout-confirm {
  background: linear-gradient(135deg, #fbbf24, #e8c820);
  color: #1a1035;
}

/* 手机 / 小程序 web-view：底部 sheet */
@media (max-width: 768px) {
  body.auth-modal-sheet .login_form_con,
  .login_form_con {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
    transform: translate3d(0, 100%, 0);
    max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }

  body.auth-modal-sheet .login_form_con.is-open,
  .login_form_con.is-open {
    transform: translate3d(0, 0, 0);
  }

  body.auth-modal-sheet .login_form_con::before,
  .login_form_con::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
  }

  .login_form_top { padding: 8px 20px 12px; }
  .login_form_left { padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .login_form_back { padding: 8px 20px 0; }
  .login_form_title h3 { font-size: 18px; }

  .login_form_input input,
  .login_form_verify {
    height: 50px;
  }

  .login_form_phonenum input { padding-left: 68px; }
  .login_form_areacode { height: 48px; line-height: 48px; }

  .login_form_btn {
    height: 50px;
    line-height: 50px;
    font-size: 17px;
  }

  .login_form_verify {
    font-size: 11px;
    padding: 0 8px;
    max-width: 38%;
  }
}

body.auth-modal-sheet .login_form_con {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  transform: translate3d(0, 100%, 0);
  max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px)));
  border-radius: 18px 18px 0 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

body.auth-modal-sheet .login_form_con.is-open {
  transform: translate3d(0, 0, 0);
}

body.auth-modal-sheet .login_form_con::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

body.auth-modal-sheet .login_form_top { padding: 8px 20px 12px; }
body.auth-modal-sheet .login_form_left { padding: 0 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
body.auth-modal-sheet .login_form_back { padding: 8px 20px 0; }
