/* 全站登录 / 注册弹窗：邮箱为默认路径，GitHub 一键为备选 */
.auth-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(9, 9, 11, 0.4);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.auth-scrim[data-open="true"] { opacity: 1; }

.auth-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 65;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  opacity: 0;
  transform: translate(-50%, -46%);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.auth-dialog[data-open="true"] { opacity: 1; transform: translate(-50%, -50%); }
html.auth-lock body { overflow: hidden; }

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.auth-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.auth-caption { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* ---------- 标签 ---------- */
.auth-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  height: 38px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--border);
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.auth-tab:last-child { border-right: 0; }
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-selected="true"] { color: var(--accent); background: var(--bg); box-shadow: inset 0 2px 0 var(--accent); }

/* ---------- 表单 ---------- */
.auth-form { margin-top: 14px; }
.auth-fields { display: grid; gap: 12px; }
.auth-field { display: block; }
.auth-field-label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-3); }
.auth-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-field input::placeholder { color: var(--text-3); }
.auth-error { margin-top: 10px; font-size: 12px; color: var(--danger); }
.auth-error[hidden] { display: none; }
.auth-submit { width: 100%; height: 40px; margin-top: 14px; }

/* ---------- GitHub 备选 ---------- */
.auth-alt { margin-top: 16px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--text-4); font-size: 12px; font-style: normal; }
.auth-divider-line { flex: 1; height: 1px; background: var(--border); }
.auth-github { width: 100%; margin-top: 12px; }
.auth-github .icon { width: 16px; height: 16px; }

/* ---------- 头部已登录标记 ---------- */
.header-actions a[data-signed="in"] { color: var(--accent); }

@media (max-width: 560px) {
  .auth-dialog { padding: 16px; }
  .auth-title { font-size: 18px; }
}
