.password-field-wrap {
  position: relative;
  display: block;
}

.password-field-wrap > input {
  width: 100%;
  padding-right: 64px !important;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8a6b3e;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 7px 4px;
}

.password-rule-hint {
  margin-top: 6px;
  color: #7c7469;
  font-size: 12px;
  line-height: 1.55;
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-code-button,
.auth-text-button {
  border: 1px solid var(--theme-gold);
  background: transparent;
  color: var(--theme-gold);
  border-radius: 8px;
  cursor: pointer;
  padding: 0 12px;
  white-space: nowrap;
}

.auth-code-button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.auth-text-button {
  border: 0;
  padding: 2px;
  font-size: 13px;
}

.auth-recovery-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(35, 28, 20, .56);
}

.auth-recovery-overlay.show { display: flex; }

.auth-recovery-card {
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid rgba(200, 146, 62, .35);
  border-radius: 16px;
  background: #fffdf8;
  box-shadow: 0 22px 70px rgba(35, 28, 20, .24);
  padding: 24px;
}

.auth-recovery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-recovery-head h3 { margin: 0; }

.auth-recovery-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 22px;
}

.auth-recovery-card label {
  display: block;
  margin: 12px 0 6px;
  color: #4c4338;
  font-size: 13px;
}

.auth-recovery-card input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8cbb8;
  border-radius: 8px;
  background: #fff;
  padding: 9px 11px;
  font: inherit;
}

.auth-recovery-submit {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 9px;
  background: #b77b25;
  color: #fff;
  cursor: pointer;
  padding: 12px;
  font-weight: 600;
}

.auth-recovery-status {
  min-height: 20px;
  margin-top: 10px;
  color: #b3261e;
  font-size: 13px;
  line-height: 1.5;
}

.auth-recovery-status.success { color: #287456; }

@media (max-width: 520px) {
  .auth-code-row { grid-template-columns: 1fr; }
  .auth-code-button { min-height: 40px; }
}

/* [主题补全] 8.15 认证恢复、验证码与密码控件的深色视觉适配。 */
html[data-theme="dark"] .password-toggle,
html[data-theme="dark"] .auth-text-button,
html[data-theme="dark"] .auth-recovery-close {
  background-color: var(--theme-surface-soft);
  border-color: var(--theme-line);
  color: var(--theme-text-2);
}

html[data-theme="dark"] .password-rule-hint,
html[data-theme="dark"] .auth-recovery-status {
  color: var(--theme-text-3);
}

html[data-theme="dark"] .auth-recovery-overlay {
  background-color: color-mix(in srgb, var(--theme-canvas) 78%, transparent);
}

html[data-theme="dark"] .auth-recovery-card {
  background-color: var(--theme-surface);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .auth-recovery-head,
html[data-theme="dark"] .auth-recovery-card label {
  color: var(--theme-text-1);
}

html[data-theme="dark"] .auth-recovery-card input {
  background-color: var(--theme-surface-raised);
  border-color: var(--theme-line-strong);
  caret-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .auth-recovery-submit {
  background-color: var(--theme-gold-soft);
  border-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .auth-recovery-submit:hover {
  background-color: var(--theme-gold);
  border-color: var(--theme-gold);
  color: var(--theme-text-1);
}

html[data-theme="dark"] .auth-recovery-close:focus-visible {
  outline-color: var(--theme-gold);
  box-shadow: 0 0 0 4px var(--theme-gold-soft);
}

html[data-theme="dark"] .auth-code-button {
  border-color: var(--theme-cinnabar);
  color: var(--theme-cinnabar);
}
html[data-theme="dark"] .auth-code-button:hover {
  background: rgba(183, 108, 93, 0.12);
}
html[data-theme="dark"] .auth-code-button:disabled {
  background-color: var(--theme-surface-soft);
  border-color: var(--theme-line);
  color: var(--theme-text-disabled);
}

html[data-theme="dark"] .auth-recovery-status.success {
  color: var(--theme-pine);
}

