/* ============ 首页登录 / 注册浮层 ============
 * 与工作台 public/css/style.css 里的 .auth-* 保持同款卡片结构；
 * 变量全部收敛到 .auth-card 上（--a-*），不依赖首页 :root 的深色变量，
 * 也不依赖工作台的浅色变量，因此首页与工作台都能安全复用。
 * 首页只需引入本文件；工作台继续使用 style.css 里原有的一套。
 */
/* 遮罩淡入：避免点击瞬间整屏亮度突变，观感上像「闪一下」 */
@keyframes authMaskIn { from { opacity: 0 } to { opacity: 1 } }
.auth-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(6, 10, 20, .60);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow: auto;
  animation: authMaskIn .18s ease-out both;
}
.auth-mask.hide { display: none; }

.auth-card {
  --a-line: #e5e7eb; --a-bg: #f4f6f9; --a-text: #1f2329; --a-muted: #8a919f;
  --a-primary: #2563eb; --a-primary-dark: #1d4ed8;
  position: relative; width: 400px; max-width: 100%;
  background: #fff; color: var(--a-text);
  border-radius: 14px; padding: 26px 28px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  text-align: left;
}
.auth-card *, .auth-card *::before, .auth-card *::after { box-sizing: border-box; }
.auth-card a { color: var(--a-primary); text-decoration: none; }
.auth-card img { display: block; max-width: 100%; }

.auth-close {
  position: absolute; right: 10px; top: 8px; width: 28px; height: 28px;
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  color: var(--a-muted); cursor: pointer; border-radius: 6px;
}
.auth-close:hover { background: var(--a-bg); color: var(--a-text); }

.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.auth-logo .alogo-img { width: 46px; height: 46px; object-fit: contain; display: block; flex: 0 0 46px; }
.auth-logo b { display: block; font-size: 15px; letter-spacing: .5px; }
.auth-logo small { display: block; margin-top: 2px; color: var(--a-muted); font-size: 11.5px; }

.auth-gate-tip {
  margin: -6px 0 14px; padding: 8px 10px;
  background: #fff7e6; border: 1px solid #ffe1a8; color: #a45b00;
  border-radius: 8px; font-size: 12.5px; line-height: 1.5;
}

.auth-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--a-line); margin-bottom: 16px; }
.auth-tab {
  border: 0; background: transparent; padding: 8px 16px; font-size: 13px;
  color: var(--a-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tab.active { color: var(--a-primary); font-weight: 600; border-bottom-color: var(--a-primary); }

.af-label { display: block; font-size: 12px; color: var(--a-muted); margin: 12px 0 5px; }
.af-input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--a-line); border-radius: 8px; font-size: 13px;
  color: var(--a-text); background: #fff;
}
.af-input:focus { outline: none; border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.af-row { display: flex; gap: 8px; }
.af-row .af-input { flex: 1; }
.af-between { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 2px; font-size: 12px; }
.af-check { display: inline-flex; align-items: center; gap: 5px; color: var(--a-muted); cursor: pointer; }
.af-check input { margin: 0; }
.af-submit { width: 100%; height: 40px; margin-top: 16px; font-size: 14px; letter-spacing: 2px; }
.af-tip { min-height: 18px; margin-top: 8px; font-size: 12px; }
.af-tip.err { color: #dc2626; }
.af-tip.ok { color: #16a34a; }
.auth-foot { margin-top: 14px; text-align: center; font-size: 12px; color: var(--a-muted); }

/* 作用域限定：不要覆盖首页自己的 .btn / .btn-p 等按钮 */
.auth-card .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0;
  height: 38px; padding: 0 14px; border: 1px solid var(--a-line); border-radius: 6px;
  background: #fff; color: var(--a-text); font-size: 13px; cursor: pointer;
  transform: none; box-shadow: none; text-decoration: none;
}
.auth-card .btn:hover { border-color: var(--a-primary); color: var(--a-primary); transform: none; box-shadow: none; }
.auth-card .btn.primary { background: var(--a-primary); border-color: var(--a-primary); color: #fff; }
.auth-card .btn.primary:hover { background: var(--a-primary-dark); border-color: var(--a-primary-dark); color: #fff; }
.auth-card .btn:disabled { opacity: .6; cursor: not-allowed; }
.auth-card .af-row .btn { flex-shrink: 0; min-width: 106px; }

@media (max-width: 420px) {
  .auth-card { padding: 22px 20px 18px; }
}
