/* ============================================================
   登录门户
   复用 site.css 的设计 token（颜色都过了 WCAG 实测），
   这里只写门户自己的结构样式。
   ============================================================ */

.gate {
  max-width: 620px;
  padding: calc(var(--bar-h) + var(--bar-top) + 48px) 24px 96px;
}
.gate__head { margin-bottom: 30px; }
.gate__head .lede { margin-top: 14px; }

/* site.css 里的 .rise 默认是 opacity:0 / 下移 16px，要靠 site.js 加上 is-in 才显形。
   门户页没有引 site.js（也不该为一个入场动画多引一个脚本），所以这里自己播一次。
   【别删这段】删掉的话整页内容会变成全透明，看起来像白屏。 */
.gate .rise { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .gate .rise {
    animation: gate-rise .52s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 55ms);   /* 依次入场，用页面里已有的 --i */
  }
  @keyframes gate-rise {
    from { opacity: 0; transform: translate3d(0, 14px, 0); }
  }
}

/* ------------------------------------------------------------ 卡片 */

/* 【必须保留】作者样式里的 .btn{display:inline-flex} 优先级高于浏览器默认的
   [hidden]{display:none}，所以 el.x.hidden = true 的按钮会照样显示出来。
   只在 login.css 里加这个兜底；其它页面（手机导航靠 is-open 类切换、
   从不摘掉 hidden 属性）加了会把导航锁死。 */
[hidden] { display: none !important; }

.authcard { padding: 28px; }
.authcard__title {
  margin: 0 0 20px;
  font-size: 17px; font-weight: 650; letter-spacing: -.2px;
  color: var(--ink);
}
.authcard__actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; }
.authcard__actions--wrap { flex-wrap: wrap; }

/* ------------------------------------------------------------ 表单 */

.field { margin-bottom: 16px; }
.field > label {
  display: block; margin-bottom: 7px;
  color: var(--muted); font-size: 12.5px; font-weight: 600;
}
.field__row { position: relative; display: flex; }
.field input {
  width: 100%; height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;          /* 16px：iOS 上小于这个值聚焦会自动放大页面 */
  font-family: inherit;
  transition: border-color .18s var(--ease-io), box-shadow .18s var(--ease-io);
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(50, 123, 156, .14);
}
.field__row input { padding-right: 48px; }

/* 眼睛：切换口令可见。默认显示「睁眼」，点开后换成「斜杠眼」。 */
.eye {
  position: absolute; right: 6px; top: 6px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent;
  color: var(--muted-2); cursor: pointer;
  transition: color .18s var(--ease-io), background-color .18s var(--ease-io);
}
.eye:hover { color: var(--ink); background: rgba(28, 72, 84, .06); }
.eye:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.eye svg { width: 19px; height: 19px; }
/* 【必须显式写】内联 SVG 上 `el.hidden = true` 不会同步到 HTML 属性，
   注意与 site.css 的关系：作者样式会盖过 UA 的 [hidden]{display:none}，
   所以这里必须自己兜底，否则两个图标会同时显示叠在一起。 */
.eye svg[hidden] { display: none; }

/* 动态码：字距拉开，一眼看清是 6 位 */
.field--totp input {
  letter-spacing: .34em;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
  padding-left: 18px;
}
.field__hint { margin: 8px 0 0; color: var(--muted-2); font-size: 12px; line-height: 1.55; }

.formmsg {
  min-height: 20px; margin: 4px 0 0;
  font-size: 13px; line-height: 1.5; color: var(--rose);
}
.formmsg.is-ok { color: var(--mint); }
.formmsg.is-info { color: var(--muted); }

/* ------------------------------------------------------- 已登录状态 */

.me { display: flex; gap: 13px; align-items: flex-start; }
.me__dot {
  flex: none; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(53, 163, 133, .16);
}
.me .authcard__title { margin-bottom: 4px; }
.me__who { margin: 0; color: var(--muted); font-size: 13.5px; }

.btn.danger { color: var(--rose); border-color: rgba(207, 106, 106, .34); }
.btn.danger:hover { background: rgba(207, 106, 106, .07); }

/* ---------------------------------------------------------- 登录记录 */

.logs { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.logs summary {
  cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600;
  list-style: none;
}
.logs summary::-webkit-details-marker { display: none; }
.logs summary::before { content: "▸ "; color: var(--muted-2); }
.logs[open] summary::before { content: "▾ "; }
.logs__body { margin-top: 12px; display: grid; gap: 7px; }
.logrow {
  display: flex; gap: 10px; align-items: baseline;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(28, 72, 84, .035);
  font-size: 12.5px; color: var(--muted);
}
.logrow b { color: var(--ink); font-weight: 600; }
.logrow .ok { color: var(--mint); font-weight: 600; }
.logrow .no { color: var(--rose); font-weight: 600; }
.logrow time { margin-left: auto; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------- 说明（诚实版） */

.sec { margin-top: 52px; }
.sec__title {
  margin: 0 0 16px;
  font-size: 13px; font-weight: 650; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
}
.impl__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.impl__list li {
  position: relative; padding-left: 20px;
  color: var(--muted); font-size: 13.5px; line-height: 1.62;
}
.impl__list li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--mint);
}
.impl__list b { color: var(--ink-2); font-weight: 600; }
.impl__note {
  margin: 20px 0 0;
  padding: 14px 16px;
  border-left: 2px solid var(--amber);
  border-radius: 0 10px 10px 0;
  background: rgba(201, 129, 42, .07);
  color: var(--ink-2); font-size: 13px; line-height: 1.7;
}

@media (max-width: 560px) {
  .gate { padding-left: 18px; padding-right: 18px; }
  .authcard { padding: 22px; }
  .authcard__actions .btn { flex: 1 1 auto; justify-content: center; }
}
