/* 登录页：整屏左右分栏（左 3/5 深色角色舞台 + 右 2/5 白底登录侧，2026-10 改版，脱离 mountShell） */

/* base.css 的 scrollbar-gutter:stable 会在右侧常驻滚动条槽、透出 body 深色底；
   登录页右栏为白底，根元素同步白色让槽位隐形 */
html {
  background: #fff;
}

/* 整屏左右分栏（非卡片）：左 3/5 角色舞台（深色），右 2/5 白底登录侧 */
.login {
  flex: 1;
  display: flex;
  align-items: stretch;
}

/* 右侧登录侧：白底，表单垂直居中，备案号沉底 */
.login-side {
  flex: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2.5rem 0;
  background: #fff;
  color: #1a2a33;
  /* 全站 color-scheme: dark（base.css），但本栏是浅色表单：显式改回 light，
     否则 Chrome 自动填充会按深色方案画白字（UA 样式压过普通 CSS）→ 灰底白字 */
  color-scheme: light;
}

.login-form {
  display: grid;
  gap: 0.7rem;
  width: min(22rem, 100%);
  /* auto 上下 margin 吸收剩余空间 → 表单垂直居中、备案号自然沉底 */
  margin: auto 0;
}

/* 白底右侧的高对比表单配色：标签加粗加大、输入框浅灰底黑框黑字（与纯白面板区分开）、按钮藏蓝底白字 */
.login-side .login-form__label {
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.login-side .login-form__input {
  color: #000;
  font-size: 1rem;
  background: #eef1f4;
  border: 1.5px solid #000;
}

/* 聚焦态也用黑框（加粗区分），不用全站默认的青色 */
.login-side .login-form__input:focus {
  border-color: #000;
  outline: 1.5px solid #000;
}

/* 自动填充兜底：旧内核不识别 color-scheme 时，强制黑字 + 内阴影模拟灰底
   （:-webkit-autofill 的 UA 样式带高优先级，只能用这两招覆盖） */
.login-side .login-form__input:-webkit-autofill,
.login-side .login-form__input:-webkit-autofill:hover,
.login-side .login-form__input:-webkit-autofill:focus {
  -webkit-text-fill-color: #000;
  caret-color: #000;
  -webkit-box-shadow: 0 0 0 1000px #eef1f4 inset;
  transition: background-color 9999s ease-in-out 0s;
}

.login-side .login-form__submit {
  color: #fff;
  font-weight: 700;
  background: #0f2157;
}

.login-side .login-form__passtoggle {
  color: #333;
}

.login-side .login-form__passtoggle:hover {
  color: #000;
}

/* 表单标题：居中大字号黑字，与下方表单拉开距离 */
.login-form__title {
  margin: 0 0 1.8rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  color: #000;
}

.login-form__label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.login-form__input {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.55em 0.8em;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--duration-normal) var(--ease-out-expo);
}

.login-form__input:focus {
  border-color: var(--cyan);
}

.login-form__error {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--red-badge);
}

.login-form__submit {
  font: inherit;
  font-size: 0.88rem;
  letter-spacing: 0.3em;
  margin-top: 0.6rem;
  padding: 0.6em 1em;
  color: var(--badge-ink);
  font-weight: 600;
  background: var(--cyan);
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.login-form__submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

.login-form__submit:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* 备案号：白底右侧沉底居中（mono 数字语感与全站一致） */
.login-beian {
  margin: 0 0 1.4rem;
  padding-top: 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.login-beian a {
  color: #444;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.login-beian a:hover {
  color: #000;
}

.login-beian a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ===== 浅色主题适配（2026-09 双主题二阶段） =====
   dark 保持上方白底独立风格原样；light 下右侧登录侧改用浅灰数据舱变量
   （左角色舞台底已走 var(--panel)，随主题自动翻浅，无需覆盖）。 */
html[data-theme='light'] {
  background: var(--bg);
}

[data-theme='light'] .login-side {
  background: var(--bg);
  color: var(--text);
}

[data-theme='light'] .login-side .login-form__label,
[data-theme='light'] .login-form__title {
  color: var(--text);
}

[data-theme='light'] .login-side .login-form__input {
  color: var(--text);
  background: var(--panel);
  border-color: var(--hairline-strong);
}

[data-theme='light'] .login-side .login-form__input:focus {
  border-color: var(--cyan);
  outline-color: var(--cyan);
}

[data-theme='light'] .login-side .login-form__input:-webkit-autofill,
[data-theme='light'] .login-side .login-form__input:-webkit-autofill:hover,
[data-theme='light'] .login-side .login-form__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--panel) inset;
}

/* 白天主题：实色深青压得太重，改选中按钮同款半透明青 */
[data-theme='light'] .login-side .login-form__submit {
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid var(--cyan-border);
}

[data-theme='light'] .login-side .login-form__passtoggle {
  color: var(--text-dim);
}

[data-theme='light'] .login-side .login-form__passtoggle:hover {
  color: var(--text);
}

[data-theme='light'] .login-beian a {
  color: var(--text-dim);
}

[data-theme='light'] .login-beian a:hover {
  color: var(--text);
}

/* ===== 动画角色登录页（2026-10 复刻 animated-characters-login-page，交互逻辑见 js/login-characters.js） ===== */

/* 左栏角色舞台：整高深色，去面板边框/圆角（非卡片）；窄屏（≤900px）隐藏 */
.login-stage {
  flex: 3;
  min-width: 0;
  display: grid;
  /* 萌宠舞台在左栏垂直水平双居中 */
  place-items: center;
  padding: 2rem 1rem;
  background: var(--panel);
  overflow: hidden;
  /* 数据舱网格纹理，与首页地图底纹呼应 */
  background-image:
    linear-gradient(var(--panel-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--panel-border) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center bottom;
  background-blend-mode: soft-light;
}

/* 舞台坐标系固定 550×400，窄屏整体缩放防溢出 */
.lc-stage {
  position: relative;
  width: 550px;
  height: 400px;
  flex: none;
}

@media (max-width: 1280px) {
  .lc-stage {
    transform: scale(0.82);
    transform-origin: bottom center;
  }
}

@media (max-width: 1024px) {
  .lc-stage {
    transform: scale(0.66);
    transform-origin: bottom center;
  }
}

@media (max-width: 900px) {
  .login-stage {
    display: none;
  }

  /* 窄屏：白底登录侧独占全宽 */
  .login-side {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lc-char,
  .lc-eyes,
  .lc-mouth,
  .lc-ymouth,
  .lc-eyeball,
  .lc-pupil,
  .lc-lonepupil {
    transition: none !important;
    animation: none !important;
  }
}

/* --- 角色本体 --- */
.lc-char {
  position: absolute;
  bottom: 0;
  /* 倾斜/位移/身高由 JS 阻尼插值逐帧驱动（login-characters.js），不走 CSS transition——
     否则每帧重写 transform 会反复打断过渡，造成卡顿/回弹/退出输入后不复位 */
  transform-origin: bottom center;
  will-change: transform;
}

/* 入场动画（原作时序：紫 1.2s / 橙 1.1s+0.1 / 黑 1s+0.2 / 黄 1s+0.3） */
.lc-char--purple { animation: lc-in-purple 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
.lc-char--orange { animation: lc-in-orange 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards; }
.lc-char--black  { animation: lc-in-black 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards; }
.lc-char--yellow { animation: lc-in-yellow 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s backwards; }
.lc-char.lc-entered { animation: none; }

@keyframes lc-in-purple {
  0% { transform: translateX(-150px) translateY(50px) rotate(-15deg) scale(0.3); opacity: 0; }
  60% { transform: translateX(10px) translateY(-10px) rotate(3deg) scale(1.05); }
  100% { transform: translateX(0) translateY(0) rotate(0) scale(1); opacity: 1; }
}

@keyframes lc-in-black {
  0% { transform: translateY(-100px) scale(0.5); opacity: 0; }
  70% { transform: translateY(10px) scale(1.08); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes lc-in-orange {
  0% { transform: translateX(-200px) translateY(80px) rotate(-25deg) scale(0.2); opacity: 0; }
  65% { transform: translateX(15px) translateY(-8px) rotate(5deg) scale(1.1); }
  100% { transform: translateX(0) translateY(0) rotate(0) scale(1); opacity: 1; }
}

@keyframes lc-in-yellow {
  0% { transform: translateX(200px) translateY(60px) rotate(20deg) scale(0.3); opacity: 0; }
  65% { transform: translateX(-12px) translateY(-5px) rotate(-4deg) scale(1.06); }
  100% { transform: translateX(0) translateY(0) rotate(0) scale(1); opacity: 1; }
}

/* --- 眼睛 --- */
.lc-eyes {
  position: absolute;
  display: flex;
  /* left/top 由 JS 阻尼驱动 */
  will-change: left, top;
}

.lc-eyeball {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: height 0.15s ease-out, border-radius 0.3s, transform 0.3s;
  will-change: height, transform;
}

/* 眨眼：压扁成一条线（150ms 由 JS 摘挂 class） */
.lc-blink {
  height: 2px !important;
}

.lc-blink .lc-pupil {
  display: none;
}

/* 悲伤眼（黑角色）：下半圆 + 外八旋转（旋转角度由 JS 按左右眼注入） */
.lc-eyeball--sad {
  height: 8px !important;
  border-radius: 0 0 16px 16px !important;
}

.lc-pupil {
  border-radius: 50%;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

.lc-lonepupil {
  border-radius: 50%;
  transition: transform 0.1s ease-out, height 0.15s ease-out;
  will-change: transform, height;
}

/* --- 嘴巴 --- */
.lc-mouth {
  position: absolute;
  background-color: #2d2d2d;
  /* left/top 由 JS 阻尼驱动；宽/高/圆角/形态 transform 保留过渡（表情切换渐变） */
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lc-mouth--purple {
  width: 24px;
  height: 8px;
  border-radius: 0 0 12px 12px;
}

/* 输入中：紫嘴竖成一条（"嘘"），并抵消身体倾斜保持竖直 */
.lc-mouth--purple.lc-mouth--typing {
  width: 7px;
  height: 32px;
  border-radius: 0;
  transform: translateX(13.5px) translateY(-28px) var(--counter-skew, skewX(0deg));
}

.lc-mouth--purple.lc-mouth--sad {
  width: 24px;
  height: 8px;
  border-radius: 12px 12px 0 0;
}

.lc-mouth--orange {
  width: 26px;
  height: 13px;
  border-radius: 0 0 13px 13px;
}

.lc-mouth--orange.lc-mouth--typing {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translateX(6px);
}

.lc-mouth--orange.lc-mouth--sad {
  width: 26px;
  height: 13px;
  border-radius: 13px 13px 0 0;
}

/* 黄色嘴巴：SVG path，d 属性过渡（Chromium 系支持；JS 同步写 attribute 兜底）；位置由 JS 阻尼驱动 */
.lc-ymouth {
  position: absolute;
}

.lc-ymouth-path {
  d: path('M0 10 Q10 10, 20 10 Q30 10, 40 10 Q50 10, 60 10 Q70 10, 80 10');
  transition: d 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.lc-ymouth-path--wavy {
  d: path('M0 10 Q10 2, 20 10 Q30 18, 40 10 Q50 2, 60 10 Q70 18, 80 10');
}

/* --- 密码可见性切换钮（偷瞄梗的触发器） --- */
.login-form__passwrap {
  position: relative;
}

.login-form__passwrap .login-form__input {
  width: 100%;
  padding-right: 2.4em;
  box-sizing: border-box;
}

.login-form__passtoggle {
  position: absolute;
  right: 0.4em;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color var(--duration-normal) var(--ease-out-expo);
}

.login-form__passtoggle:hover {
  color: var(--text);
}

.login-form__passtoggle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}
