/* ===========================================================
   X本真 · 登录弹框（表单部分）
   依赖：theme.css（色板/按钮）、modal.css（.modal 外壳与 .toast）
   =========================================================== */

.modal__card--login { padding-bottom: 22px; }

.lgn { margin: 20px 0 0; display: block; }

.lgn__field { display: block; margin: 0 0 14px; }

.lgn__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.lgn__input {
  width: 100%;
  height: 46px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.lgn__input::placeholder { color: #bdb4a5; }
.lgn__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(168, 135, 79, 0.13);
}
.lgn__input.is-bad { border-color: #c2836f; background: #fdf6f2; }

.lgn__row { display: flex; gap: 10px; align-items: stretch; }
.lgn__row .lgn__input { flex: 1; }

.lgn__send {
  flex: none;
  min-width: 116px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #f6f1e6;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.lgn__send:hover:not(:disabled) { background: #f1e8d5; border-color: var(--gold-soft); }
.lgn__send:disabled { color: var(--ink-3); background: #f4efe5; cursor: default; }

.lgn__err {
  display: block;
  font-style: normal;
  font-size: 12px;
  line-height: 1.6;
  color: #b06b55;
  margin-top: 6px;
  min-height: 0;
}
.lgn__err:empty { display: none; }
.lgn__err--center { text-align: center; }

.lgn__agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  cursor: pointer;
}
.lgn__agree input {
  flex: none;
  width: 15px;
  height: 15px;
  margin: 4px 0 0;
  accent-color: var(--gold);
  cursor: pointer;
}
.lgn__link { color: var(--gold); border-bottom: 1px solid rgba(126, 94, 46, 0.35); }
.lgn__link:hover { color: #6d5027; }

.lgn__submit { width: 100%; justify-content: center; margin-top: 18px; }
.lgn__submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.lgn__hint { margin: 10px 0 0; text-align: center; font-size: 11.5px; color: var(--ink-3); }

.lgn__or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--ink-3);
  font-size: 11.5px;
}
.lgn__or::before,
.lgn__or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.lgn__wechat {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: #3f4a3f;
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.lgn__wechat:hover { background: #f7f6f2; border-color: #cfd8cb; }
.lgn__wechat svg { width: 19px; height: 19px; color: #4c8a4c; }

.lgn__demo {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: #bcb2a0;
}

/* ── 登录 / 注册 双 tab（2026-11-12）────────── */
.lgn__tabs {
  display: flex;
  gap: 6px;
  margin: 16px 0 0;
  padding: 4px;
  border-radius: 999px;
  background: #f2ece0;
  border: 1px solid var(--line);
}
.lgn__tab {
  flex: 1;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.lgn__tab:hover { color: var(--ink-2); }
.lgn__tab.is-on {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(40, 32, 20, 0.1);
}
.modal__body h2 { margin-bottom: 6px; }
form.lgn[hidden] { display: none; }

/* ── 滑块拼图验证 ─────────────────────────── */
.cap { margin: 18px 0 0; }
.cap__stage {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #ece2ce;
  line-height: 0;
}
.cap__canvas { display: block; width: 100%; height: auto; }
.cap.is-bad .cap__stage { animation: capShake 0.34s ease; }
.cap.is-ok .cap__stage { box-shadow: inset 0 0 0 2px rgba(94, 132, 96, 0.55); }

.cap__track {
  position: relative;
  height: 46px;
  margin: 12px 0 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4eee2;
  overflow: hidden;
  user-select: none;
  touch-action: none;
}
.cap__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 46px;
  background: linear-gradient(90deg, #f0e2c4, #f7eeda);
  transition: width 0.06s linear;
}
.cap__tip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cap__handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--gold);
  cursor: grab;
  box-shadow: 0 3px 10px rgba(40, 32, 20, 0.16);
  touch-action: none;
  transition: box-shadow 0.16s ease, background 0.16s ease;
  will-change: transform;
}
.cap__handle svg { width: 18px; height: 18px; }
.cap__handle:hover { background: #fffdf8; }
.cap__handle.is-drag { cursor: grabbing; box-shadow: 0 4px 14px rgba(40, 32, 20, 0.22); }
.cap.is-ok .cap__handle { background: #eef3e9; color: #4c7a52; border-color: #b9cbb2; }
.cap.is-ok .cap__tip { color: #4c7a52; }
.cap.is-bad .cap__handle { background: #fdf1ec; color: #b06b55; border-color: #e2c3b7; }

@keyframes capShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  55% { transform: translateX(5px); }
  80% { transform: translateX(-3px); }
}

/* ── 完善资料 ─────────────────────────────── */
.modal { overflow-y: auto; align-items: safe center; }

.pf { margin: 20px 0 0; }

.pf__avatar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}

.pf__avatar {
  flex: none;
  width: 66px;
  height: 66px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #d8cdb8;
  border-radius: 50%;
  background: #f7f1e6;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 22px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.pf__avatar:hover { border-color: var(--gold-soft); background: #f3ebdc; }
.pf__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pf__avatar-tip { display: flex; flex-direction: column; gap: 3px; }
.pf__avatar-tip b { font-size: 13.5px; font-weight: 500; }
.pf__avatar-tip span { font-size: 11.5px; color: var(--ink-3); }
.pf__linkbtn {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: none;
  font-size: 12.5px;
  color: var(--gold);
  border-bottom: 1px solid rgba(126, 94, 46, 0.35);
  cursor: pointer;
}
.pf__linkbtn:hover { color: #6d5027; }

.pf__note { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.lgn__input[readonly] { background: #f4f0e7; color: var(--ink-2); }

.pf__area {
  height: 88px;
  padding: 12px 15px;
  line-height: 1.7;
  resize: vertical;
  font-family: var(--sans);
}

.pf__actions { display: flex; gap: 10px; margin: 20px 0 0; }
.pf__actions .btn { flex: 1; justify-content: center; }

/* 已登录：账号小卡片 ───────────────────── */
.acc__who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
}
.acc__avatar {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #efe6d3;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 16px;
}
.acc__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.acc__meta { display: flex; flex-direction: column; gap: 2px; }
.acc__meta b { font-size: 14px; font-weight: 500; }
.acc__meta span { font-size: 11.5px; color: var(--ink-3); }

.acc__actions { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 0; }
.acc__actions .btn { width: 100%; justify-content: center; }
.acc__quit {
  border: none;
  background: none;
  padding: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
  cursor: pointer;
}
.acc__quit:hover { color: #b06b55; }

/* 顶栏已登录态 */
.topbar__actions .login.is-in { color: var(--ink); letter-spacing: 0.03em; }
.topbar__actions .login.is-in::after {
  content: "· 已登录";
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 6px;
}

/* 顶栏头像（换成图片时不留内边距） */
.user__avatar.is-photo { overflow: hidden; background: none; }
.user__avatar.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 右上角「退出」按钮（登录后由 login.js 自动插入） ── */
.xbz-logout {
  height: 34px;
  padding: 0 15px;
  font-size: 13px;
  border-radius: 999px;
  white-space: nowrap;
}
.topbar__actions .xbz-logout { margin-left: 4px; }

/* ── 独立登录页 /login.html ───────────────── */
body.page-login {
  min-height: 100vh;
  background:
    radial-gradient(1100px 720px at 78% -10%, rgba(168, 135, 79, 0.16), transparent 62%),
    radial-gradient(820px 560px at 8% 108%, rgba(74, 104, 87, 0.13), transparent 58%),
    var(--paper);
}
.page-login .modal { padding: 24px; }
.page-login .modal__mask { background: transparent; backdrop-filter: none; animation: none; }
.page-login .modal__card { box-shadow: 0 30px 80px rgba(40, 32, 20, 0.14); }
.page-login .modal__x { display: none; }
.page-login .lgn__back {
  margin: 6px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
.page-login .lgn__back a { color: var(--gold); border-bottom: 1px solid rgba(168, 135, 79, 0.35); }


/* 登录页锁死：点框外时抖一下提示（2026-11-01 12:40） */
@keyframes xbzNudge {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}
.modal__card.is-nudge { animation: xbzNudge .38s ease; }
.modal__x[hidden] { display: none !important; }
