/* ============================================================
   login.css —— 登录 / 注册页
   ------------------------------------------------------------
   登录页是这栋房子的**门**：进门（这里）和进屋（便签墙 / 看板）
   必须是同一个世界，否则登录瞬间"换了一套系统"。
   视觉令牌逐字镜像 note.css 的 body.page-note（值不改，只换作用域）：
   暖木桌面 + 米白纸片 + 方角 + 纸张投影；暗色＝树荫，同一张桌子换光线。

   红线（与 note.css / board.css 同一套）：
     · 不引入第二套色板；颜色只来自 tokens 语义色 / 纸皮肤令牌
     · 无渐变、无毛玻璃、无发光
     · 圆角只用 --n-radius（纸片方角）与 --radius-ctrl（控件 4px）
   ============================================================ */

/* ============================================================
   1. 纸皮肤令牌层（镜像 note.css，值一字不改）
   ============================================================ */
body.login-body {
  --desk: #F5F1E9;
  --paper: #FFFCF3;
  --bg: #EFEBE3;
  --topbar-bg: rgba(245, 241, 233, .78);
  --sheet-bg: #FFFDF8;

  --dot: rgba(28, 24, 18, .05);
  --scroll-thumb: rgba(28, 24, 18, .15);
  --scroll-thumb-hover: rgba(28, 24, 18, .25);

  --shadow-note:
    rgba(60, 45, 20, .13) 0 2px 3px,
    rgba(60, 45, 20, .1) 0 8px 18px,
    rgba(60, 45, 20, .045) 0 16px 30px;
  --shadow-pop:
    rgba(60, 45, 20, .1) 0 3px 8px,
    rgba(60, 45, 20, .12) 0 14px 30px,
    rgba(60, 45, 20, .14) 0 28px 60px;

  --n-radius: 3px;
  --topbar-h: 48px;
}

html[data-theme="dark"] body.login-body {
  --bg: #18251E;
  --desk: #1C2A22;
  --paper: #24332A;
  --topbar-bg: rgba(24, 37, 30, .78);
  --sheet-bg: #202E25;

  --dot: rgba(214, 240, 220, .06);
  --scroll-thumb: rgba(214, 240, 220, .15);
  --scroll-thumb-hover: rgba(214, 240, 220, .24);

  --shadow-note:
    rgba(0, 0, 0, .42) 0 4px 16px,
    rgba(0, 0, 0, .26) 0 2px 5px;
  --shadow-pop:
    rgba(0, 0, 0, .35) 0 3px 8px,
    rgba(0, 0, 0, .4) 0 14px 30px,
    rgba(0, 0, 0, .45) 0 28px 60px;
}

/* ============================================================
   2. 复位与骨架（与 board.css 同构）
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body.login-body {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s4, 16px);
  background: var(--bg);
  color: var(--text-1);
  font: var(--fs-body)/var(--lh) var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 复位整包 :where() 压到 (0,0,0)，原因见 note.css / board.css 的同款注释：
   写成 body.login-body button（0,1,2）会盖掉组件字号声明 */
::where(body.login-body button) { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
::where(body.login-body input) { font-family: inherit; font-size: inherit; color: inherit; }
body.login-body a { color: inherit; text-decoration: none; }

::where(body.login-body button):focus-visible,
::where(body.login-body input):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

/* ============================================================
   3. 纸片卡：与便签同一张纸
   ============================================================ */
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: var(--n-radius);
  box-shadow: var(--shadow-note);
  padding: 40px 32px 28px;
}

.login-brand { text-align: center; margin-bottom: var(--s6); }

/* 圆形头像：剪影用 currentColor 画。底色取纸皮肤的中性暖灰（不再是旧版的
   蓝灰渐变 —— 渐变在红线里，且蓝灰属于另一套系统）。
   剪影颜色用 --text-2：比 --text-1 轻、比 --text-3 重，安静地立在那里。 */
.login-avatar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s3);
  overflow: hidden;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}
.login-avatar svg { width: 100%; height: 100%; display: block; }

.login-brand h1 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.2px;
  color: var(--text-1);
}

/* ============================================================
   4. 表单
   ============================================================ */
.login-card .field { margin-bottom: var(--s4); }
/* 标签压小压淡：干净感靠留白，不靠去掉标签（注册三个字段光靠占位符分不清） */
.login-card .field-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-aux);
  color: var(--text-2);
}
/* 输入框：填充式（无可见硬边框），底色比纸深半档，聚焦时亮出主色环。
   高度 42px 是登录页唯一比主界面大的控件 —— 输密码是全页唯一的动作，
   目标区值得放大；颜色仍全部来自纸皮肤令牌。 */
.login-card .input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-ctrl);
  background: var(--dot);
  color: var(--text-1);
  outline: none;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.login-card .input::placeholder { color: var(--text-3); }
.login-card .input:focus {
  background: var(--sheet-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.login-card .input.invalid {
  border-color: var(--danger-emphasis);
  background: var(--danger-soft);
}

/* 行内校验提示：只在确实填错时出现（非常驻说明） */
.field-err {
  margin-top: 5px;
  font-size: var(--fs-aux);
  line-height: 1.5;
  color: var(--danger-emphasis);
}

.login-error {
  margin-bottom: var(--s3);
  padding: var(--s2) var(--s3);
  font-size: var(--fs-aux);
  color: var(--danger-emphasis);
  background: var(--danger-soft);
  border: 1px solid var(--tint-danger);
  border-radius: var(--radius-ctrl);
}

/* ============================================================
   5. 登录 / 注册切换：与主界面 .seg 同款分段控件
   ============================================================ */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  margin-bottom: var(--s4);
  border-radius: var(--radius-ctrl);
  background: var(--border-soft);
}
.login-tab {
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-2);
  font-size: var(--fs-aux);
  white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.login-tab:hover { color: var(--text-1); }
/* 选中态与 .seg button.on 同款：白块 + 轻投影，不加粗（grid 定宽，跳不了，但
   全系统"选中不加粗"要一刀切，否则又是两套语言） */
.login-tab.on {
  background: var(--sheet-bg);
  color: var(--text-1);
  box-shadow: rgba(0, 0, 0, .07) 0 1px 2px;
}

/* ============================================================
   6. 主按钮：与主界面 .btn-primary 同款（4px 圆角，不再是 9px 大圆角）
   ============================================================ */
.btn-block {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-ctrl);
  background: var(--primary);
  color: #fff;
  font-size: var(--fs-sub);
  font-weight: 500;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: background .15s ease, transform .1s ease;
}
.btn-block:hover { background: var(--primary-hover); }
.btn-block:active { transform: translateY(.5px); }
.btn-block:disabled { opacity: .5; cursor: not-allowed; }

/* ============================================================
   7. 眼睛按钮
   ============================================================ */
.input-eye { position: relative; }
.input-eye .input { padding-right: 44px; }
.eye-btn {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  transform: translateY(-50%);
  transition: color .14s ease, background .14s ease;
}
.eye-btn svg { width: 17px; height: 17px; display: block; }
.eye-btn .ic-hide { display: none; }
.eye-btn.on .ic-show { display: none; }
.eye-btn.on .ic-hide { display: block; }
.eye-btn:hover { color: var(--text-1); background: var(--border-soft); }