/* ============================================================
   视图：登录 / 注册（auth.js）
   风格：黑白极简，整屏居中一张 360px 卡片；深浅主题跟随 html.dark
   只用 styles.css 的组件类（.card/.field/.input/.btn/.seg/.hint）与 CSS 变量，
   不写死任何颜色
   ============================================================ */

/* ---------- 整屏舞台：父页面藏起导航后，卡片独立撑满屏幕 ---------- */
.auth-screen{
  position:fixed; inset:0; z-index:40;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; padding:24px; overflow:auto;
  background:var(--bg); color:var(--fg);
  animation:auth-fade .18s ease;
}
@keyframes auth-fade{from{opacity:0}to{opacity:1}}

/* ---------- 卡片 ---------- */
.auth-screen .auth-card{
  width:100%; max-width:360px; flex:none;
  padding:22px 22px 20px;
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
  animation:auth-pop .2s ease;
}
@keyframes auth-pop{from{transform:translateY(6px);opacity:.5}to{transform:none;opacity:1}}

/* ---------- 品牌 ---------- */
.auth-brand{display:flex; align-items:center; gap:10px; margin-bottom:18px; min-width:0}
.auth-logo{
  width:38px; height:38px; border-radius:10px; flex:none;
  background:var(--fg); color:var(--bg);
  display:flex; align-items:center; justify-content:center;
  font-size:17px; font-weight:700; letter-spacing:-.5px;
}
.auth-brand-txt{min-width:0}
.auth-name{
  font-size:15px; font-weight:600; letter-spacing:-.2px; line-height:1.3;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.auth-sub{
  font-size:11.5px; color:var(--muted); line-height:1.4;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* ---------- 登录 / 注册 tab（.seg 的满宽版本） ---------- */
.auth-screen .auth-tabs{
  display:flex; width:100%; margin:0 0 16px; padding:3px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm);
}
.auth-screen .auth-tabs button{
  flex:1; min-width:0; padding:7px 0;
  border:0; border-radius:var(--radius-xs); background:transparent;
  color:var(--muted); font-size:13px; cursor:pointer; transition:.14s;
}
.auth-screen .auth-tabs button:hover{color:var(--fg)}
.auth-screen .auth-tabs button.on{
  background:var(--card); color:var(--fg); font-weight:600; box-shadow:var(--shadow);
}
.auth-screen .auth-tabs button:focus-visible{outline:2px solid var(--fg); outline-offset:1px}

/* ---------- 表单 ---------- */
.auth-form .field{margin-bottom:12px}
.auth-screen .auth-form .input{height:36px}

/* 一行红字错误提示 */
.auth-err{
  margin:-4px 0 10px; font-size:12px; line-height:1.5;
  color:var(--err); word-break:break-word;
}

.auth-screen .auth-submit{
  margin-top:2px; height:36px; font-size:13.5px; font-weight:600;
}
.auth-screen .auth-submit:disabled{opacity:.55}

.auth-hint{margin-top:10px; text-align:center; line-height:1.5}

/* ---------- 底部（主题切换）：绝对定位，卡片才能严格垂直居中 ---------- */
.auth-foot{
  position:absolute; left:0; right:0; bottom:16px;
  display:flex; align-items:center; justify-content:center; gap:8px;
}

/* ---------- 小屏 / 动效偏好 ---------- */
@media(max-width:420px){
  .auth-screen{padding:16px; gap:10px}
  .auth-screen .auth-card{padding:18px 16px 16px}
  .auth-name{font-size:14px}
}
@media(max-height:540px){
  .auth-screen{justify-content:flex-start}
  .auth-foot{position:static; margin-top:2px}
}
@media(prefers-reduced-motion:reduce){
  .auth-screen, .auth-screen .auth-card{animation:none}
}
