/* auth.fenli.org —— 认证中心样式。
 *
 * 品牌：标志上的蓝（#0b7cbe，eBible Fellowship 的那枚蓝色 e）为主色，金 #a8813a 作点缀。
 * 零第三方资源：系统字体栈、图标用内联 SVG 或 data: 遮罩（CSP style-src 'self'，页面里没有任何 style="" 与 <style>）。
 * 布局：单列居中（顶栏 → 品牌 → 卡片 → 页脚）；手机取消卡片边界，内容直接落在画布上。
 * 面向长辈：正文 16px，控件 ≥52px 高，触控目标 ≥44px，正文与主色对白底均 ≥4.5:1。
 *
 * 主题三态（与主站一致）：html[data-theme="dark"] 强制深色，html[data-theme="light"] 强制浅色，
 * 两者都没有时跟随 prefers-color-scheme。深色令牌因此写两遍，改一处务必改另一处。
 *
 * 文件顺序：令牌 → 基础 → 布局外壳 → 顶栏菜单 → 品牌 → 卡片 → 文字 → 表单 → 按钮
 *          → 状态条 → 账号中心 → 页脚 → 响应式 → 偏好（减少动效 / 打印）。
 */

/* ═══════════ 1. 设计令牌 ═══════════ */
/* P1-01 / P3（/login）：颜色、圆角、字体、阴影全部取自 tokens.css（layout.ejs 先引 tokens.css、components.css，
 * 再引本文件），这里只做别名，深浅切换由 tokens.css 的 :root[data-theme] / prefers-color-scheme 统一处理。
 * 只有 auth 独有的金色点缀、氛围底和图标遮罩还在本文件里定义（深色写两遍，改一处务必改另一处）。 */
:root {
  /* 品牌 */
  --brand: var(--brand-text);          /* 标志蓝：只用于标志、装饰与强调边框，不用于小字 */
  --brand-d: var(--primary-hover);
  --gold: #a8813a; --gold-soft: #f6efe1;

  /* 中性：--bg / --surface / --surface-2 直接用 tokens.css 的同名变量 */
  --bg-glow-a: rgba(11, 124, 190, .10);
  --bg-glow-b: rgba(168, 129, 58, .07);
  --field: var(--surface);
  --t1: var(--text); --t2: var(--text-2); --t3: var(--text-3);
  --hair: var(--border); --hair-s: var(--border-strong);

  /* 主色（文字 / 边框级） */
  --accent: var(--primary); --accent-d: var(--primary-hover); --accent-l: var(--brand-400);
  --accent-soft: var(--primary-soft); --accent-ink: var(--on-primary);
  --ring: color-mix(in srgb, var(--focus) 32%, transparent);

  --green: var(--success); --green-soft: var(--success-soft);
  --red: var(--danger); --red-soft: var(--danger-soft);
  --amber-soft: #fdf3e0;

  --r-card: var(--r-lg); --r-input: var(--r-md);
  --shadow-card: var(--shadow-2);
  --shadow-pop: var(--shadow-1);
  --shadow-menu: var(--shadow-2);

  /* 字体：系统黑体（方案 0.2.6：中文不用宋体）；--serif 只是旧名，同样指向黑体 */
  --font: var(--font-sans);
  --serif: var(--font-sans);
  --mono: var(--font-mono);
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* 状态条图标（遮罩用，颜色取 currentColor） */
  --ic-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.6v5.2M12 16.4h.01'/%3E%3C/svg%3E");
  --ic-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.4M12 7.6h.01'/%3E%3C/svg%3E");
  --ic-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.3 2.7 2.7L16 9.6'/%3E%3C/svg%3E");
  --ic-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --ic-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");

  color-scheme: light dark;
}

/* 深色（跟随系统；html[data-theme="light"] 时不生效）——只剩 auth 独有的几项，其余由 tokens.css 切换 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gold: #d0ac68; --gold-soft: rgba(208, 172, 104, .14);
    --bg-glow-a: rgba(70, 170, 228, .13);
    --bg-glow-b: rgba(208, 172, 104, .07);
    --amber-soft: rgba(208, 172, 104, .13);
    color-scheme: dark;
  }
}

/* 深色（用户显式选择，压过系统设置）——与上面那份保持一致 */
:root[data-theme="dark"] {
  --gold: #d0ac68; --gold-soft: rgba(208, 172, 104, .14);
  --bg-glow-a: rgba(70, 170, 228, .13);
  --bg-glow-b: rgba(208, 172, 104, .07);
  --amber-soft: rgba(208, 172, 104, .13);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ═══════════ 2. 基础 ═══════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  color: var(--t1); font: 16px/1.65 var(--font);
  background: var(--bg);
  /* 极淡的氛围底：正常看页面时不该先注意到它（规格 §46） */
  background-image:
    radial-gradient(1200px 680px at -10% -20%, var(--bg-glow-a), transparent 60%),
    radial-gradient(820px 560px at 110% 116%, var(--bg-glow-b), transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-d); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.input:focus-visible { outline: none; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 10px 14px; border-radius: 8px; z-index: 40; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: max(13px, .92em); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ═══════════ 2b. 与 components.css 同名的类 ═══════════ */
/* components.css 先加载；下面这些类在 auth 里另有含义（顶栏不是毛玻璃吸顶、.list 是无边框的项目列表……），
 * 把会从 components.css 漏进来的属性压回去。新页面若要用 components 的组件，直接用它没有在这里被覆盖的类名。 */
.topbar { position: static; height: auto; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 0; }
.brand { font-size: inherit; white-space: normal; }
.list { background: none; border: 0; border-radius: 0; overflow: visible; }
.empty { display: block; text-align: left; }
.nowrap { white-space: normal; }
.btn { height: auto; line-height: 1.4; white-space: normal; }
.btn-sm { height: auto; }
.input { height: auto; }
.steps-text { list-style: decimal; }
/* components.css 把所有链接去掉下划线；正文段落里的链接要能和普通文字分开 */
.lead a, .hint a, .alert a, .notice a, .check a, .muted a, .sect a:not(.btn), .list-item a:not(.btn) { text-decoration: underline; }

/* ═══════════ 3. 布局外壳 ═══════════ */
.shell {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  width: 100%; max-width: 900px; margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.shell > * { min-width: 0; }

.main {
  flex: 1 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px 0 26px;
}
.main:focus { outline: none; }

/* ═══════════ 4. 顶栏（外观 / 语言） ═══════════ */
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 4px; flex-wrap: wrap; }

.menu { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 8px 12px; border-radius: 10px;
  color: var(--t2); font-size: 14px; cursor: pointer; list-style: none;
  transition: background .15s, color .15s;
}
.menu-btn::-webkit-details-marker { display: none; }
.menu-btn::after {
  content: ''; width: 13px; height: 13px; flex: none; background: currentColor; opacity: .7;
  -webkit-mask: var(--ic-chevron) center / contain no-repeat; mask: var(--ic-chevron) center / contain no-repeat;
  transition: transform .15s var(--ease);
}
.menu[open] > .menu-btn::after { transform: rotate(180deg); }
.menu-btn:hover { background: var(--surface-2); color: var(--t1); }
.menu-btn .ic-sm { width: 17px; height: 17px; flex: none; opacity: .8; }

.menu-list {
  position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; min-width: 168px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow-menu);
  animation: menu-in .16s var(--ease) both;
}
.menu-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 9px 12px; border-radius: 9px;
  color: var(--t1); text-decoration: none; font-size: 14.5px; white-space: nowrap;
}
.menu-list a:hover { background: var(--surface-2); }
.menu-list a[aria-current] { color: var(--accent); font-weight: 600; }
.menu-list a[aria-current]::after {
  content: ''; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--ic-check) center / contain no-repeat; mask: var(--ic-check) center / contain no-repeat;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ═══════════ 5. 品牌 ═══════════ */
.brand {
  display: flex; flex-direction: column; align-items: center; gap: 13px;
  margin: 0 0 22px; padding: 4px; text-decoration: none; color: inherit; text-align: center;
}
.brand-logo { width: 56px; height: auto; flex: none; display: block; }
.brand-text { display: block; }
.brand-name { display: block; font-size: 20px; font-weight: 700; letter-spacing: .01em; line-height: 1.25; }
/* eBible Fellowship 的小写 e 是品牌签名，任何情况下都不要 text-transform */
.brand-latin { display: block; margin-top: 3px; font-size: 13px; color: var(--t3); letter-spacing: .085em; font-weight: 500; text-transform: none; }
.brand:hover .brand-name { color: var(--accent); }

/* ═══════════ 6. 卡片 ═══════════ */
.card {
  position: relative; min-width: 0;
  width: min(440px, 100%);
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 32px 32px 26px;
  animation: card-in .26s var(--ease) both;
}
.card > * { min-width: 0; }
.shell-wide .card { width: min(720px, 100%); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ═══════════ 6b. 登录页：好处栏 + 卡片两栏，手机卡片在前（设计稿 pages/login.html） ═══════════ */
/* 栅格、.benefits、.icon-tile、.field、.or、.btn-block 来自 components.css；这里只补 auth 外壳里的尺寸与间距 */
.page-login .shell { max-width: 1040px; }
.page-login .main { align-items: stretch; }
.page-login .brand { align-self: center; }
.page-login .auth-grid { width: 100%; padding: 0; }
.page-login .card { width: 100%; }
.auth-card > * { margin: 0; }
.auth-card .h1 { text-align: left; font-size: 24px; }
.auth-card .h1 + .lead { margin-top: -6px; font-size: 15px; }
.auth-card .form { display: flex; flex-direction: column; gap: var(--s-4); }
.auth-card .form > * { margin-top: 0; }
.auth-card .form .btn-primary { margin-top: var(--s-1); }
.auth-card .field label { color: var(--t1); font-size: 14.5px; }
.auth-card .field .error { margin: 2px 0 0; }
.auth-card .field .error .i { flex: none; }
.auth-card .kv { align-items: center; }
.auth-card .kv a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; margin: -12px -8px -12px 0; font-size: var(--fs-sm); font-weight: 500; text-decoration: none; border-radius: 8px; }
.auth-card .kv a:hover { background: var(--accent-soft); }
.auth-card .or { margin: var(--s-1) 0; }
.auth-card .stack { gap: var(--s-3); }
.auth-card .stack > * { margin: 0; }
.auth-card .btn { margin-top: 0; }
.auth-card .google-note { margin-top: calc(-1 * var(--s-2)); }
.auth-card .hint { margin: 0; }
.auth-card .hint:empty { display: none; }
.auth-card .cancel { text-align: center; }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin-top: -4px; font-size: var(--fs-sm); color: var(--t2); }
.auth-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 6px; margin: -10px 0; font-weight: 500; text-decoration: none; border-radius: 8px; }
.auth-links a:hover { background: var(--accent-soft); }
.login-aside { display: grid; gap: var(--s-6); align-content: center; min-width: 0; }
.login-aside .page-title { font-size: 28px; }
.login-aside .benefits { margin-top: var(--s-5); }
/* 好处栏下面那句提示用设计稿的中性样式，不用 auth 的金色信息条 */
.login-aside .notice { position: static; display: flex; align-items: flex-start; gap: var(--s-3); margin: 0; padding: 14px 16px; border: 0; border-radius: var(--r-md); background: var(--surface-2); color: var(--t2); font-size: var(--fs-sm); line-height: 1.6; }
.login-aside .notice::before { display: none; }
.login-aside .notice > .i { color: var(--accent); margin-top: 1px; }
@media (max-width: 720px) {
  .page-login .auth-grid { gap: var(--s-6); }
  .login-aside { padding-top: var(--s-6); border-top: 1px solid var(--hair); }
  .login-aside .page-title { font-size: 24px; }
  .auth-card .h1 { font-size: 23px; }
}

/* ═══════════ 7. 文字 ═══════════ */
.h1 { font-size: 28px; line-height: 1.28; margin: 0 0 10px; font-weight: 700; letter-spacing: .004em; text-wrap: balance; text-align: center; }
.h2 { font-size: 17.5px; line-height: 1.4; margin: 0 0 8px; font-weight: 700; letter-spacing: .004em; }
.lead { margin: 0 0 24px; color: var(--t2); font-size: 15.5px; line-height: 1.75; }
.lead + .lead { margin-top: -14px; }
.lead strong, .hint strong { color: var(--t1); font-weight: 600; }
/* 登录首屏的副标题居中，与标题成一组；其它页面的说明是长句，左对齐更好读 */
.page-register .h1 + .lead { text-align: center; }
.shell-wide .h1 { text-align: left; font-size: 25px; }
.hint { margin: 8px 0 0; color: var(--t2); font-size: 13.5px; line-height: 1.65; }
.hint:empty { margin: 0; }
.muted { color: var(--t2); } .small { font-size: 13px; } .strong { font-weight: 600; }
.nowrap { overflow-wrap: anywhere; word-break: break-word; }
.links { margin: 22px 0 0; font-size: 14.5px; color: var(--t2); display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; justify-content: center; }
.links a { font-weight: 500; text-decoration: none; padding: 6px 2px; }
.links a:hover { text-decoration: underline; }
.shell-wide .links { justify-content: flex-start; }
.cancel { margin: 18px 0 0; text-align: center; font-size: 14px; }
.cancel a { color: var(--t2); text-decoration: none; padding: 10px 14px; border-radius: 9px; display: inline-block; min-height: 44px; }
.cancel a:hover { color: var(--t1); background: var(--surface-2); }

/* ═══════════ 8. 表单 ═══════════ */
.form { display: grid; gap: 8px; margin: 0; }
.form > * { min-width: 0; }
.label { font-size: 14.5px; font-weight: 600; color: var(--t1); margin-top: 14px; letter-spacing: .01em; }
.label:first-child { margin-top: 0; }
.input {
  width: 100%; min-width: 0; font: inherit; font-size: 16.5px; line-height: 1.4;
  padding: 13px 15px; min-height: 54px;
  border: 1.5px solid var(--hair-s); border-radius: var(--r-input);
  background: var(--field); color: var(--t1);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.input::placeholder { color: var(--t3); }
.input:hover { border-color: var(--t3); }
.input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.input:invalid:not(:placeholder-shown):not(:focus) { border-color: var(--hair-s); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--red-soft); }
.input:disabled, .input[readonly] { background: var(--surface-2); color: var(--t2); cursor: not-allowed; }
/* Chrome / Safari 自动填充：保留自动填充能力，只把它刺眼的黄色底盖成本主题的输入底 */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--t1);
  -webkit-box-shadow: 0 0 0 1000px var(--field) inset;
  caret-color: var(--t1);
  transition: background-color 100000s ease-out 0s;
}
.input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 4px var(--ring); }
.input-code { font-family: var(--mono); font-size: 27px; letter-spacing: .42em; text-align: center; padding-left: calc(15px + .42em); font-variant-numeric: tabular-nums; }
select.input { appearance: auto; }
input[type="date"].input { min-height: 54px; }
.pw-wrap { position: relative; min-width: 0; }
.pw-wrap .input { padding-right: 80px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 12px; cursor: pointer; border-radius: 8px; min-height: 44px; min-width: 44px;
}
.pw-toggle:hover { background: var(--accent-soft); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--t2); margin-top: 14px; line-height: 1.65; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }

/* ═══════════ 9. 按钮 ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 12px 18px; margin-top: 12px;
  border-radius: var(--r-input); border: 1.5px solid transparent;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .012em; text-decoration: none; cursor: pointer;
  transition: background .16s, border-color .16s, color .16s, transform .08s, box-shadow .16s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
/* 实色，不用渐变也不发光（规格 §14） */
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-d); }
.btn-primary:active { background: var(--accent-d); }
.btn-secondary { background: var(--surface); color: var(--t1); border-color: var(--hair-s); box-shadow: var(--shadow-pop); }
.btn-secondary:hover { border-color: var(--brand); color: var(--accent); background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--t2); border-color: var(--hair-s); width: auto; box-shadow: none; }
.btn-ghost:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
/* 危险动作和普通主按钮必须一眼分得开（规格 §71） */
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 14px; margin-top: 0; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .58; cursor: progress; transform: none; }
.btn .ic { width: 20px; height: 20px; flex: none; opacity: .9; }
.btn-secondary:hover .ic { opacity: 1; }
/* 加载中：按钮不改变宽度，只换内容（规格 §14） */
.btn .spin { width: 18px; height: 18px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.linklike { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14.5px; font-weight: 500; padding: 10px 8px; cursor: pointer; min-height: 44px; border-radius: 8px; }
.linklike:hover { text-decoration: underline; }
.linklike[disabled] { color: var(--t3); cursor: default; text-decoration: none; }
.inline { display: inline; } .inline-form { margin-top: 6px; text-align: center; }
.shell-wide .inline-form { text-align: left; }
.stack { display: grid; gap: 10px; }
.stack > * { min-width: 0; margin-top: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { width: auto; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--t3); font-size: 13px; margin: 22px 0 12px; letter-spacing: .04em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--hair); }
.btn-google .g-mark { width: 19px; height: 19px; flex: none; }

/* ═══════════ 10. 状态条 ═══════════ */
.alert, .notice, .flash {
  position: relative; border-radius: 12px; padding: 12px 15px 12px 42px;
  font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; border: 1px solid transparent; text-align: left;
}
.alert::before, .notice::before, .flash::before {
  content: ''; position: absolute; left: 14px; top: 13px; width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.alert { --ic: var(--ic-alert); background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.alert a { color: inherit; font-weight: 600; }
.notice { --ic: var(--ic-info); background: var(--amber-soft); color: var(--t1); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }
.notice::before { color: var(--gold); }
.flash { --ic: var(--ic-info); background: var(--surface-2); color: var(--t1); border-color: var(--hair); }
.flash-ok { --ic: var(--ic-ok); background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 26%, transparent); }
.flash-err { --ic: var(--ic-alert); background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 26%, transparent); }
.pill { display: inline-block; font-size: 13px; padding: 2px 9px; border-radius: 999px; font-weight: 600; vertical-align: 2px; line-height: 1.7; letter-spacing: .02em; }
.pill-ok { background: var(--green-soft); color: var(--green); }

/* 终态页图标 */
.error-mark, .ok-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 20px; }
.error-mark { background: var(--gold-soft); color: var(--gold); }
.ok-mark { background: var(--green-soft); color: var(--green); }
.error-mark svg, .ok-mark svg { width: 27px; height: 27px; }

/* 账号 chip（第二步：明确告诉用户在登录哪个账号） */
.account-chip {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--hair); border-radius: 14px; margin: 0 0 22px; background: var(--surface-2);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(150deg, var(--accent-l), var(--brand-d));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px;
}
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.avatar-img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-row { display: flex; gap: 16px; align-items: center; }
.avatar-row > div { min-width: 0; }
.chip-email { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 15px; font-weight: 500; }

/* 步骤条 */
.steps { list-style: none; padding: 0; margin: 2px 0 22px; display: flex; gap: 8px; font-size: 13px; color: var(--t3); }
.steps li { flex: 1; padding: 9px 0 0; border-top: 3px solid var(--hair); border-radius: 3px; transition: border-color .2s, color .2s; text-align: center; }
.steps li.cur { color: var(--accent); border-color: var(--brand); font-weight: 600; }
.steps li.done { color: var(--green); border-color: var(--green); }
.steps-text { padding-left: 20px; text-align: left; }
.steps-text li { margin: 6px 0; }

/* 帮助折叠 */
.help { margin: 22px 0 0; font-size: 14px; color: var(--t2); border-top: 1px solid var(--hair); padding-top: 16px; }
.help summary { cursor: pointer; color: var(--accent); font-weight: 500; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.help summary::-webkit-details-marker { display: none; }
.help summary::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.help[open] summary::before { transform: rotate(45deg); }
.help p { margin: 10px 0 0; }

/* ═══════════ 11. 账号中心 ═══════════ */
.acct-nav {
  display: flex; gap: 4px; margin: -4px 0 24px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--hair); border-radius: 13px;
  overflow-x: auto; scrollbar-width: none;
}
.acct-nav::-webkit-scrollbar { display: none; }
.acct-nav a {
  flex: 1; text-align: center; padding: 11px 12px; border-radius: 9px; text-decoration: none;
  color: var(--t2); white-space: nowrap; font-weight: 500; font-size: 14.5px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.acct-nav a:hover { color: var(--t1); }
.acct-nav a.cur { color: var(--accent); background: var(--surface); box-shadow: var(--shadow-pop); font-weight: 600; }
.sect { padding: 24px 0; border-top: 1px solid var(--hair); }
.sect:first-of-type { border-top: 0; padding-top: 4px; }
.sect > p { margin: 6px 0 14px; }
.sect.danger .h2 { color: var(--red); }
.list { list-style: none; margin: 12px 0 16px; padding: 0; display: grid; gap: 10px; }
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--hair); border-radius: 13px; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.list-item:hover { border-color: var(--hair-s); background: var(--surface-2); }
.list-item > div { min-width: 0; }
.list-item form { margin: 0; flex: none; }
/* 空状态：一句为什么值得做，加一个动作（规格 §74） */
.empty { padding: 18px; border: 1px dashed var(--hair-s); border-radius: 13px; color: var(--t2); font-size: 14.5px; margin: 12px 0 16px; }
.qr { width: 208px; max-width: 100%; margin: 12px 0; padding: 12px; background: #fff; border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--shadow-pop); }
.qr svg { display: block; width: 100%; height: auto; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: .06em; overflow-wrap: anywhere; }
.codes {
  list-style: none; padding: 18px 20px; margin: 0 0 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px;
  background: var(--surface-2); border: 1px dashed var(--hair-s); border-radius: 14px;
}
.codes code { font-family: var(--mono); font-size: 17px; letter-spacing: .06em; background: none; padding: 0; }

/* 桌面：账号中心卡片内左侧导航 */
@media (min-width: 900px) {
  .shell-wide .card {
    display: grid; grid-template-columns: 172px minmax(0, 1fr); column-gap: 34px; align-items: start;
  }
  .shell-wide .card > * { grid-column: 2; }
  .shell-wide .card > .acct-nav {
    grid-column: 1; grid-row: 1 / span 60; align-self: start; position: sticky; top: 20px;
    flex-direction: column; gap: 2px; margin: 2px 0 0; padding: 0;
    background: none; border: 0; overflow: visible;
  }
  .shell-wide .card > .acct-nav a { text-align: left; justify-content: flex-start; padding: 11px 14px; border-radius: 10px; }
  .shell-wide .card > .acct-nav a:hover { background: var(--surface-2); }
  .shell-wide .card > .acct-nav a.cur { background: var(--accent-soft); box-shadow: none; }
}

/* ═══════════ 12. 页脚 ═══════════ */
.foot { margin-top: auto; padding: 18px 0 4px; text-align: center; color: var(--t3); }
.foot-verse {
  margin: 0 0 12px; color: var(--t3); font-family: var(--font); font-size: 14.5px; line-height: 1.85;
  max-width: 30em; margin-inline: auto;
}
.foot-verse-ref { display: block; margin-top: 2px; font-family: var(--font); font-size: 13px; letter-spacing: .07em; opacity: .85; }
.foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; font-size: 13.5px; }
.foot-links li + li::before { content: '·'; margin-right: 6px; opacity: .55; }
.foot-links a { color: var(--t2); text-decoration: none; padding: 8px 2px; display: inline-block; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
/* 品牌尾注：始终提示用户身处 EBF 的身份服务（规格 §93 / §105） */
.foot-mark { margin: 8px 0 0; font-size: 13px; letter-spacing: .06em; color: var(--t3); opacity: .8; }

/* ═══════════ 12b. 忙碌态与确认对话框 ═══════════ */
/* 闲 / 忙两层叠放：都占位，只切 visibility，按钮宽度恒定 */
.btn-swap { display: inline-grid; align-items: center; justify-items: center; }
.btn-swap > * { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 10px; }
.swap-busy { visibility: hidden; }
.btn[aria-busy="true"] .swap-idle { visibility: hidden; }
.btn[aria-busy="true"] .swap-busy { visibility: visible; }

/* 高风险确认：只用于退出所有设备、移除通行密钥、解绑等，登录本身不进对话框（规格 §77） */
.dlg {
  width: min(400px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--hair); border-radius: 18px;
  background: var(--surface); color: var(--t1); box-shadow: var(--shadow-menu);
}
.dlg::backdrop { background: rgba(9, 14, 20, .42); backdrop-filter: blur(2px); }
.dlg-box { margin: 0; padding: 26px 24px 20px; }
.dlg-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.4; }
.dlg-body { margin: 10px 0 0; color: var(--t2); font-size: 14.5px; line-height: 1.7; }
.dlg-body[hidden] { display: none; }
.dlg-actions { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 22px; }
.dlg-actions .btn { margin-top: 0; }

/* ═══════════ 13. 响应式 ═══════════ */
/* 手机：取消卡片边界，内容直接落在画布上（规格 §36） */
@media (max-width: 640px) {
  .shell { max-width: 560px; padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .main { padding: 16px 0 24px; justify-content: flex-start; }
  .brand { margin-bottom: 22px; gap: 11px; }
  .brand-logo { width: 48px; }
  .brand-name { font-size: 18.5px; }
  .card, .shell-wide .card {
    width: 100%; background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0;
  }
  .h1 { font-size: 25px; }
  .shell-wide .h1 { font-size: 23px; }
  .lead { font-size: 15px; }
  .menu-label { display: none; }          /* 顶栏只留图标，不与品牌抢视线（规格 §56） */
  .menu-btn { padding: 8px 10px; }
  .codes { grid-template-columns: 1fr; }
  .list-item { flex-wrap: wrap; }
  .acct-nav a { flex: none; }
  .foot { padding-top: 26px; }
  .foot-verse { font-size: 14px; }
}
@media (max-width: 360px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .input-code { font-size: 23px; letter-spacing: .3em; padding-left: calc(15px + .3em); }
  .h1 { font-size: 23px; }
}
/* 手机横屏：视高很小，标志缩小、经文让位，保证表单和按钮都够得着（规格 §86） */
@media (max-height: 460px) and (orientation: landscape) {
  .main { justify-content: flex-start; padding: 4px 0 14px; }
  .brand { flex-direction: row; gap: 12px; margin-bottom: 12px; }
  .brand-logo { width: 32px; }
  .brand-text { text-align: left; }
  .brand-name { font-size: 17px; }
  .card { padding: 20px 22px 18px; }
  .h1 { font-size: 21px; margin-bottom: 6px; }
  .lead { font-size: 14px; margin-bottom: 16px; }
  .menu-btn { min-height: 40px; padding: 6px 10px; }
  .foot-verse { display: none; }
}
/* 平板与超宽屏：内容宽度不跟着视口长（规格 §87 / §88） */
@media (min-width: 1600px) {
  .shell { max-width: 960px; }
}

/* ═══════════ 14. 用户偏好 ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .btn .spin { animation: spin 1.2s linear infinite !important; }   /* 只保留必要的加载指示 */
}
@media (prefers-contrast: more) {
  :root { --hair: var(--hair-s); --t2: var(--t1); }
  .input { border-width: 2px; }
}
@media print {
  body { background: #fff; }
  .topbar, .brand, .acct-nav, .btn, .skip, .cancel, .foot-links, .foot-mark { display: none !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
}

/* ═══════════ 15. 扫码登录网页版（views/pages/login.ejs .qr-login；public/js/qrlogin.js；docs/QR_LOGIN.md）═══════════ */
/* 二维码底板固定白色（深色外观下扫码对比度也够）；遮罩文字因此用固定深色。动效只有淡入淡出 ≤200ms。 */
.qr-login { margin-top: 4px; }
.qr-panel { margin-top: 12px; padding: 16px; border: 1px solid var(--hair-s); border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.qr-title { margin: 0 0 12px; color: var(--t1); font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.qr-box { position: relative; display: grid; place-items: center; width: 216px; height: 216px; margin: 0 auto; padding: 8px; border-radius: var(--r-md); background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.qr-img { display: block; width: 200px; height: 200px; transition: opacity .2s ease; }
.qr-img.is-dim { opacity: .1; }
.qr-spin { width: 28px; height: 28px; border: 3px solid var(--accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.qr-mask { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; border-radius: var(--r-md); }
.qr-mask-text { display: flex; flex-direction: column; gap: 2px; margin: 0; color: #1d1d1f; font-size: 15px; font-weight: 600; line-height: 1.5; }
.qr-name { font-weight: 700; }
.qr-avatar { display: grid; place-items: center; width: 48px; height: 48px; overflow: hidden; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; font-weight: 700; }
.qr-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.qr-refresh { min-width: 132px; }
.qr-status { margin-top: 12px; }
.qr-noapp { margin: 6px 0 0; }
@media (prefers-reduced-motion: reduce) {
  .qr-spin { animation: spin 1.2s linear infinite !important; }   /* 同 .btn .spin：只保留必要的加载指示 */
}
