.auth-user-wrap {
  margin-left: auto;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
}
.auth-login-btn {
  border: 1px solid rgba(45,212,191,0.45);
  background: rgba(8,16,24,0.55);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.auth-login-btn:hover { background: rgba(45,212,191,0.12); }
.auth-user-btn {
  max-width: 160px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(8,12,18,0.65);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: rgba(12,16,24,0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 6px;
  z-index: 40;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.auth-dropdown.show { display: block; }
.auth-dropdown button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.auth-dropdown button:hover { background: rgba(255,255,255,0.06); }
.auth-dropdown button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.auth-dropdown button:disabled:hover { background: transparent; }

.auth-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(2,6,12,0.78);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-mask.show { display: flex; }
.auth-card {
  position: relative;
  width: min(440px, 94vw);
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(18,24,34,0.98), rgba(10,14,22,0.98));
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.55);
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs button {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  font-weight: 650;
}
.auth-tabs button.active {
  color: var(--text);
  border-color: rgba(45,212,191,0.45);
  background: rgba(45,212,191,0.1);
}
.auth-tabs.hidden { display: none; }
.auth-register-tabs { margin-bottom: 10px; }
.auth-register-tabs button { font-size: 12px; padding: 8px 6px; }
.auth-panel { display: none; }
.auth-panel.active { display: block; }
.auth-register-form.hidden { display: none; }
.auth-qr.hidden { display: none; }
.auth-field.hidden { display: none; }
.auth-form-register {
  max-width: 340px;
  margin: 4px auto 0;
  padding: 0 4px;
}
.auth-form-register .auth-field--inline {
  grid-template-columns: 68px minmax(0, 1fr);
  margin-bottom: 10px;
}
.auth-form-register .auth-field--inline input,
.auth-inline-sms input {
  margin: 0;
  height: 38px;
  box-sizing: border-box;
}
.auth-form-error {
  min-height: 0;
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: #fb7185;
  text-align: left;
}
.auth-form-error:empty {
  display: none;
  margin: 0;
}
.auth-form-register .auth-form-error {
  margin-bottom: 8px;
}
.auth-form-center .auth-form-error {
  margin-top: 28px;
  margin-bottom: 8px;
}
.auth-form-register .auth-agreement {
  margin: 6px 0 8px;
  line-height: 1.55;
}
.auth-form-register .auth-submit {
  margin-top: 2px;
}
.auth-form-register .auth-links {
  margin-top: 10px;
}
.auth-form-register .auth-qr {
  padding: 0;
  gap: 0;
}
.auth-form-register .auth-qr-status {
  max-width: 300px;
}
.auth-note--compact {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
}
.auth-inline-sms {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.auth-inline-sms:focus-within {
  border-color: rgba(45,212,191,0.35);
}
.auth-inline-sms input {
  flex: 1;
  min-width: 0;
  width: auto;
  border: 0;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  padding: 0 12px;
  font-size: 14px;
}
.auth-inline-sms input:focus {
  outline: none;
}
.auth-sms-btn {
  flex-shrink: 0;
  align-self: stretch;
  height: auto;
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: rgba(154, 236, 224, 0.92);
  border-radius: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-sms-btn:hover {
  color: #d1faf5;
  background: rgba(45,212,191,0.1);
}
.auth-sms-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
  background: transparent;
}
.auth-field { margin-bottom: 12px; }
.auth-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.auth-row { display: flex; gap: 8px; align-items: center; }
.auth-row input { flex: 1; }
.auth-submit {
  width: 100%;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #14b8a6, #34d399);
}
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}
.auth-links button {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.auth-check { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0; font-size: 12px; color: var(--muted); }
.auth-check input { margin-top: 3px; }
.auth-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
}
.auth-wx-login {
  width: 300px;
  height: 260px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.auth-wx-login iframe {
  width: 300px !important;
  height: 300px !important;
  border: 0;
  display: block;
  /* 微信 iframe 内容顶对齐，下移并裁掉底部空白，视觉居中 */
  transform: translateY(28px);
}
.auth-qr-status {
  margin: 10px 0 0;
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}
.auth-qr-status:empty {
  display: none;
  margin: 0;
}
.auth-qr-panel .auth-form-center {
  max-width: none;
  margin-top: 12px;
  padding: 0;
}
#authPanelWxRegister .auth-form-register {
  max-width: none;
  margin-top: 8px;
  padding: 0;
}
#authPanelWxRegister .auth-qr {
  min-height: 260px;
}
#authPanelWxRegister .auth-links {
  margin-top: 12px;
}
.auth-close {
  flex-shrink: 0;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.auth-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}
.auth-card-wrap { position: relative; }
.auth-card-head--center {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 40px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.auth-card-head--center h2 {
  margin: 0;
  font-size: 18px;
  line-height: 32px;
  font-weight: 700;
}
.auth-card-head--center .auth-close {
  position: absolute;
  right: 0;
  top: 0;
}
.auth-login-body {
  position: relative;
  padding: 10px 0 0;
  min-height: 240px;
}
.auth-mode-toggle {
  position: absolute;
  top: 6px;
  right: 0;
  z-index: 2;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(238, 243, 248, 0.72);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}
.auth-mode-toggle.hidden { display: none; }
.auth-mode-toggle:hover {
  color: rgba(238, 243, 248, 0.95);
}
.auth-mode-toggle:hover .auth-mode-toggle-badge {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}
.auth-mode-toggle-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #2d3748;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.15s ease;
}
.auth-mode-toggle-badge--account { display: none; }
.auth-mode-toggle.is-wx .auth-mode-toggle-badge--qr { display: none; }
.auth-mode-toggle.is-wx .auth-mode-toggle-badge--account { display: flex; }
.auth-mode-toggle-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.auth-mode-toggle-label {
  display: flex;
  align-items: center;
  height: 38px;
  min-width: 4em;
  font-weight: 500;
  white-space: nowrap;
}
.auth-form-center {
  max-width: 340px;
  margin: 32px auto 0;
  padding: 0 4px;
}
.auth-qr-panel {
  padding-top: 0;
  padding-bottom: 0;
}
.auth-qr-panel .auth-qr {
  padding-top: 0;
}
.auth-login-shell {
  position: relative;
  z-index: 1;
}
.auth-login-shell.hidden { display: none; }
.auth-field--inline {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.auth-field--inline label {
  margin: 0;
  text-align: right;
  font-size: 14px;
  line-height: 1;
  color: rgba(238, 243, 248, 0.88);
  white-space: nowrap;
}
.auth-field--inline label::after {
  content: '：';
}
.auth-field--inline input {
  margin: 0;
  height: 38px;
  box-sizing: border-box;
}
.auth-account-field {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.auth-account-field > input {
  flex: 1;
  min-width: 0;
}
.auth-account-field.has-picker > input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-width: 0;
}
.auth-account-picker {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 38px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 243, 248, 0.72);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-account-picker.hidden { display: none; }
.auth-account-picker:hover,
.auth-account-picker[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(238, 243, 248, 0.95);
}
.auth-account-picker-icon {
  width: 16px;
  height: 16px;
}
.auth-account-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 12;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 180px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 24, 32, 0.98);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.auth-account-menu.hidden { display: none; }
.auth-account-menu li {
  padding: 9px 12px;
  font-size: 14px;
  line-height: 1.3;
  color: rgba(238, 243, 248, 0.92);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-account-menu li:hover,
.auth-account-menu li:focus {
  background: rgba(56, 189, 248, 0.12);
  color: #fff;
}
.auth-password-field {
  display: flex;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}
.auth-password-field > input {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-width: 0;
}
.auth-password-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 38px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(238, 243, 248, 0.72);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-password-toggle:hover,
.auth-password-toggle.is-visible {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(238, 243, 248, 0.95);
}
.auth-password-toggle-icon {
  width: 18px;
  height: 18px;
}
.auth-form-center .auth-check {
  margin: 4px 0 14px;
}
.auth-form-center .auth-submit {
  margin-top: 4px;
}
.auth-panel-login-links {
  margin-top: 14px;
  margin-bottom: 0;
}
.auth-login-agreement {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.auth-note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-agreement {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 6px;
  align-items: start;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.65;
}
.auth-agreement-box {
  margin: 3px 0 0;
  grid-column: 1;
  grid-row: 1;
}
.auth-agreement-content {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  color: var(--text);
}
.auth-agreement-lead {
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.auth-agreement-links {
  display: inline;
}
.auth-agreement-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #909017;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.auth-agreement-links button:hover { color: #c8c42a; }
.auth-agreement-sep { color: var(--text); }

.agreement-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2,6,12,0.82);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.agreement-mask.show { display: flex; }
.agreement-dialog {
  width: min(920px, 96vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(18,24,34,0.98), rgba(10,14,22,0.98));
  border: 1px solid rgba(45,212,191,0.28);
  border-radius: 16px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.55);
  overflow: hidden;
}
.agreement-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.agreement-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}
.agreement-head button {
  border: 0;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.agreement-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.75;
  color: #eef3f8;
  user-select: text;
}
.agreement-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.agreement-foot button {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
}
.agreement-foot button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.agreement-foot #agreementOk {
  border: 0;
  background: linear-gradient(90deg, #14b8a6, #34d399);
  color: #fff;
  font-weight: 700;
  min-width: 96px;
}
.agreement-foot #agreementOk:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.42);
  cursor: not-allowed;
}
.agreement-page {
  min-width: 64px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.auth-loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 30;
  border-radius: 16px;
  background: rgba(8, 12, 18, 0.58);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  pointer-events: all;
}
.auth-loading-overlay.show {
  display: flex;
}
.auth-loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 30px;
  border-radius: 12px;
  background: rgba(18, 24, 34, 0.96);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}
.auth-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #2dd4bf;
  border-radius: 50%;
  animation: auth-loading-spin 0.75s linear infinite;
}
@keyframes auth-loading-spin {
  to { transform: rotate(360deg); }
}
.auth-loading-text {
  margin: 0;
  font-size: 13px;
  color: rgba(238, 243, 248, 0.88);
  letter-spacing: 0.02em;
}
