/* 账号入口与登录 / 注册 / 找回密码弹窗 */

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
}

.account-button:hover { border-color: var(--accent); color: var(--accent); }
.account-button.is-authed { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.account-avatar { font-size: 12px; line-height: 1; color: var(--accent); }

/* ---------- 弹窗 ---------- */

.auth-dialog {
  width: min(400px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-dialog::backdrop { background: rgba(18, 48, 58, 0.38); }

.auth-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }

.auth-head { display: flex; align-items: center; justify-content: space-between; }
.auth-head h2 { margin: 0; font-size: 16px; }

.auth-close {
  width: 26px; height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.auth-close:hover { border-color: var(--border); color: var(--text); }

.auth-panel { display: flex; flex-direction: column; gap: 9px; }
.auth-panel[hidden] { display: none !important; }

.auth-field { display: flex; flex-direction: column; gap: 4px; }
.auth-field > span { color: var(--muted); font-size: 12px; font-weight: 600; }

.auth-field input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.auth-field input:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }

.auth-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.auth-error {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid #e3bcb4;
  border-radius: var(--radius-sm);
  background: #fbeceb;
  color: #a33b2f;
  font-size: 12px;
  line-height: 1.5;
}

.auth-error[hidden] { display: none !important; }

.auth-submit {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #eaf5f6;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.auth-submit:hover { background: #0f3540; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-secondary {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.auth-secondary:hover { border-color: var(--accent); color: var(--accent); }

.auth-links { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }

.auth-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

.auth-link[hidden] { display: none !important; }

.auth-actions { display: flex; gap: 8px; }
.auth-actions > * { flex: 1; }

.auth-code {
  padding: 12px;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  user-select: all;
}

.auth-account {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
}

.auth-account dt { color: var(--muted); }
.auth-account dd { margin: 0; font-weight: 600; word-break: break-all; }

@media (max-width: 720px) {
  .account-button { font-size: 11px; padding: 4px 9px; }
  .auth-dialog { width: calc(100vw - 20px); }
}
