/* =========================================================
   账号页 · 独立登录屏（MS 浅色版式）
   纯白卡片 + 纯黑文字 + 浅色氛围背景 + 下划线输入 +
   右下角主按钮 + 文字链次要操作。品牌色沿用站点橙色体系。
   仅 account.html 引用。
   ========================================================= */

.auth-screen {
  --auth-fg: #1b1b1b;
  --auth-fg-dim: #616161;
  --auth-fg-faint: #8a8a8a;
  --auth-line: #8a8a8a;
  --auth-card-bg: #ffffff;
  --auth-border: #e6e3df;
  --auth-link: var(--brand-60, #c65407);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4);
  position: relative;
  overflow: hidden;
  background: #f4f3f1;
  color: var(--auth-fg);
}

/* 浅色氛围光 + 装饰曲线（纯 CSS，无图片，比深色版收敛） */
.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 460px at 16% 26%, rgba(242, 97, 12, .09), transparent 65%),
    radial-gradient(780px 560px at 84% 76%, rgba(70, 96, 148, .12), transparent 65%),
    radial-gradient(420px 320px at 72% 14%, rgba(242, 97, 12, .05), transparent 60%);
}
.auth-screen::after {
  content: "";
  position: absolute;
  width: 1100px;
  height: 1100px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .04);
  left: -360px;
  top: -300px;
  pointer-events: none;
}

/* ---------- 卡片：纯白 ---------- */
.auth-card--float {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .10);
  padding: 44px 40px 36px;
}
.auth-card__top { position: relative; text-align: left; margin-bottom: var(--space-5); }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; line-height: 28px; text-transform: capitalize; }
.auth-brand .brand__name { line-height: 1; }
.auth-brand .brand__mark { width: 28px; height: 28px; }

/* 单页多屏：每个「屏幕」默认块级，hidden 时彻底隐藏 */
.auth-screen-step { display: block; }
.auth-screen-step[hidden] { display: none; }

.auth-title { font-size: 24px; font-weight: 600; text-align: left; margin: 0 0 var(--space-4); }

/* ---------- 浅色下的表单控件 ---------- */
.auth-screen .field label { color: var(--auth-fg-dim); }
.auth-screen .input {
  background: #ffffff;
  border-color: var(--auth-line);
  color: var(--auth-fg);
}
.auth-screen .input::placeholder { color: var(--auth-fg-faint); }
.auth-screen .input:focus { border-color: var(--auth-fg); box-shadow: none; }

/* 胶囊输入（邮箱，对应 MS 的账号胶囊） */
.input--pill { border-radius: 999px; text-align: center; height: 44px; padding: 10px 16px; }

/* 下划线输入（账户名称/密码，对应 MS 的输入行） */
.input--underline {
  border: none;
  border-bottom: 1px solid var(--auth-line);
  border-radius: 0;
  background: transparent;
  padding: 10px 34px 10px 2px;
}
.input--underline:focus { border-bottom-color: #000; box-shadow: 0 1px 0 0 #000; }
.auth-screen .field--error .input { border-color: #d13438; }

.auth-screen .field__error { color: #b3261e; }
.auth-screen .field__hint { color: var(--auth-fg-faint); }

/* 「显示密码」复选框行 */
.auth-check { display: flex; gap: 8px; align-items: center; font-weight: 400; color: var(--auth-fg-dim); cursor: pointer; }

/* 验证码行 */
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .input { flex: 1; }

/* 次要按钮在浅色下的呈现 */
.auth-screen .btn--secondary {
  background: #ffffff;
  border-color: var(--auth-line);
  color: var(--auth-fg);
}
.auth-screen .btn--secondary:hover { background: #f3f2f1; border-color: var(--auth-fg); }

/* ---------- 按钮下方：条款 / 切换（文字链，MS 式） ---------- */
.auth-screen .auth-terms { color: var(--auth-fg-faint); margin-top: var(--space-4); }
.auth-screen .auth-terms a { color: var(--auth-link); }
.auth-screen .auth-terms a:hover { text-decoration: underline; }
.auth-screen .auth-switch { color: var(--auth-fg-dim); text-align: left; margin-top: var(--space-4); }
.auth-screen .auth-switch a { color: var(--auth-link); }
.auth-screen .auth-switch a:hover { text-decoration: underline; }
.auth-screen .form-msg { font-size: 13px; }

/* ---------- 底部链接行 ---------- */
/* 声明/Cookie 行：固定钉在视口右下角（仿 MS login.live.com） */
.auth-footer {
  position: fixed;
  right: 24px;
  bottom: 16px;
  z-index: 2;
  text-align: right;
  font-size: 13px;
  color: var(--auth-fg-dim);
}
.auth-footer nav { display: flex; gap: var(--space-5); justify-content: flex-end; margin-bottom: var(--space-2); flex-wrap: wrap; }
.auth-footer a { color: var(--auth-fg); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer__note { margin: 0; }
.auth-footer__note a { color: var(--auth-link); }

/* ---------- 步骤切换与加载动画 ---------- */
.auth-step { animation: authFade .25s ease; }
@keyframes authFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* MS 式加载点：圆点横穿整卡，从左端滑到右端（匀速、不重叠） */
.auth-loading {
  display: none;
  position: relative;
  width: 100%;
  height: 10px;
  margin: 0 0 var(--space-4);
}
.auth-loading.is-active { display: block; }
.auth-loading i {
  position: absolute;
  top: 1px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--auth-link);
  opacity: 0;
  animation: authDot 1.4s linear infinite;
}
.auth-loading i:nth-child(2) { animation-delay: .25s; }
.auth-loading i:nth-child(3) { animation-delay: .5s; }
@keyframes authDot {
  0%   { left: 0; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* 第一步登录介绍文案（标题下的副标题） */
.auth-intro {
  text-align: left;
  color: var(--auth-fg-dim);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

/* 左对齐的行内文字链（MS 式：没有账户？立即创建一个 / 忘记密码?） */
.auth-inline { margin-top: var(--space-4); font-size: 14px; color: var(--auth-fg-dim); }
.auth-inline a { color: var(--auth-link); text-decoration: none; }
.auth-inline a:hover { text-decoration: underline; }

/* 创建密码屏：← 邮箱回显返回链（深色，仿 MS）+ 显示密码复选框 */
.auth-inline .auth-back { display: inline-flex; align-items: center; gap: 6px; color: var(--auth-fg); font-size: 14px; }
.auth-check { margin-top: var(--space-4); }

/* 「登录选项」小框可按屏隐藏（仅登录屏显示） */
.auth-options[hidden] { display: none; }

/* 右下角主操作按钮区（MS 式「下一步」） */
.auth-actions { display: flex; justify-content: flex-end; margin-top: var(--space-5); }

/* 卡片下方的「登录选项」独立小框 */
.auth-options {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin-top: var(--space-3);
}
.auth-options a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  color: var(--auth-fg);
  text-decoration: none;
  font-size: 14px;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}
.auth-options a:hover { background: #f3f2f1; border-color: var(--auth-fg-dim); }
.auth-options__icon { width: 20px; height: 20px; }

/* ---------- 登录选项屏（MS 式全宽选项行） ---------- */
.auth-opt-list {
  border-top: 1px solid var(--auth-border);
  border-bottom: 1px solid var(--auth-border);
  margin: 0 -40px; /* 负边距抵消卡片内边距，选项行通铺整卡宽 */
}
.auth-opt-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 40px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--auth-border);
  font: inherit;
  color: var(--auth-fg);
  cursor: pointer;
  text-align: left;
}
.auth-opt-item:last-child { border-bottom: none; }
.auth-opt-item:hover { background: #f3f2f1; }
.auth-opt-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #2f2f2f;
  flex: none;
}
.auth-opt-icon img { width: 24px; height: 24px; display: block; image-rendering: pixelated; }
/* 忘记用户名行左侧的裸问号（MS 原版为无圆圈的灰色 ? 字形） */
.auth-opt-icon--qmark {
  font-size: 22px;
  font-weight: 400;
  color: var(--auth-fg-dim);
  line-height: 1;
}
.auth-opt-label { flex: 1; font-size: 15px; }
/* 圆圈问号矢量图标（GitHub 行右侧 / 忘记用户名行左侧共用） */
.auth-opt-help {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 50%;
  color: var(--auth-fg-dim);
  cursor: pointer;
  transition: color var(--motion-fast), background var(--motion-fast);
}
.auth-opt-help:hover { color: var(--auth-fg); background: rgba(0, 0, 0, .06); }
.auth-opt-help:focus-visible { outline: 2px solid var(--brand-80); outline-offset: 1px; }

/* ---------- 弹窗：GitHub 登录说明 ---------- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.auth-modal[hidden] { display: none; }
.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .42);
}
.auth-modal__card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid #e1dfdd;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  padding: 26px 26px 22px;
  animation: authModalIn .18s ease-out;
}
@keyframes authModalIn {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}
.auth-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--space-4);
}
.auth-modal__gh { color: #1b1b1b; flex: none; }
.auth-modal__title {
  font-size: 20px;
  font-weight: 600;
  color: var(--auth-fg);
  margin: 0;
}
.auth-modal__body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--auth-fg);
  margin: 0 0 var(--space-3);
}
.auth-modal__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* ---------- 数据跨境传输许可页（consent.html） ---------- */
.auth-consent p {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--auth-fg);
  margin: 0 0 var(--space-4);
}
/* 蓝字链接（仿 MS 原版：蓝色、默认无下划线） */
.auth-consent a { color: #0067b8; text-decoration: none; }
.auth-consent a:hover { text-decoration: underline; }
/* 正文中的蓝色「拒绝并退出」字样（指代下方按钮，非链接） */
.auth-consent__reject { color: #0067b8; }
/* 跨境许可屏：居右的按钮对 */
.auth-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: var(--space-5);
}

/* 恢复用户名屏：居右的 取消 / 下一步 按钮对 */
.auth-recover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: var(--space-5);
}

/* 仅供屏幕阅读器的标签 */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .auth-step { animation: none; }
  .auth-loading i { animation-duration: 1.6s; }
}

/* ---------- GitHub 登录成功屏 ---------- */
.auth-gh-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: var(--space-5) 0 var(--space-4);
}
.auth-gh-user__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--neutral-bg-3, #f3f2f1);
  flex: none;
}
.auth-gh-user__meta { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.auth-gh-user__name { font-size: 15px; font-weight: 600; color: var(--auth-fg); word-break: break-word; }
.auth-gh-user__sub { font-size: 13px; color: var(--auth-fg-dim); word-break: break-word; }

/* ---------- 邮箱验证屏（Cloudflare 人机验证 + 邮箱代码） ---------- */
.auth-verify-sub { font-size: 13px; color: var(--auth-fg-dim); margin-bottom: var(--space-3); }
.auth-verify-getcode {
  font-size: 13px;
  color: #0067b8;
  cursor: pointer;
  margin: 0 0 var(--space-4);
  user-select: none;
}
.auth-verify-getcode:hover { text-decoration: underline; }
.auth-verify-turnstile { margin: var(--space-4) 0; min-height: 64px; }
.auth-verify-turnstile__hint { font-size: 12px; color: var(--auth-fg-faint); margin: 8px 0 0; }

/* ---------- 小屏 ---------- */
@media (max-width: 520px), (max-height: 640px) {
  .auth-screen { padding: var(--space-5) var(--space-3); }
  .auth-card--float { padding: 32px 22px 28px; }
  .auth-title { font-size: 22px; }
  .auth-opt-list { margin: 0 -22px; }
  .auth-opt-item { padding: 13px 22px; }
  /* 矮屏/窄屏下取消固定定位，避免遮挡卡片 */
  .auth-footer { position: static; text-align: center; margin-top: var(--space-6); }
  .auth-footer nav { justify-content: center; }
}
