/* 登录页单独一套样式，浅青渐变走到底，正好盖掉 pear.css 里的旧登录样式 */

.pear-login {
  --pl-blue: #2f7bff;
  --pl-deep: #2563eb;
  --pl-cyan: #22b8ff;
  --pl-green: #1fc58c;
  --pl-red: #e5484d;
  --pl-gold: #f0a020;
  --pl-ink: #1a2540;
  --pl-muted: #7c8aa8;
  --pl-line: #e6ebf4;

  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 26px 18px;
  color: var(--pl-ink);
  background:
    radial-gradient(900px 520px at 18% -8%, rgba(91,215,231,.22) 0%, rgba(91,215,231,0) 60%),
    linear-gradient(160deg, #e7f7f9 0%, #f3fbfc 52%, #dfeff3 100%);
}

/* 布局容器 */
.pl-shell { position: relative; z-index: 2; width: 100%; max-width: 424px; margin: auto; }

/* 品牌区 */
.pl-brand { text-align: center; margin-bottom: 22px; animation: plUp .62s cubic-bezier(.22,.8,.28,1) both; }
.pl-logo {
  position: relative; width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center; font-size: 29px; color: #fff;
  background: linear-gradient(140deg, #3b82f6 0%, #2fd0ff 100%);
  box-shadow: 0 16px 34px -10px rgba(43,110,255,.5), inset 0 1px 0 rgba(255,255,255,.35);
  overflow: hidden;
}
.pl-logo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.4), transparent 45%); }
.pl-logo i { position: relative; z-index: 1; }
.pl-brand h1 { margin: 0 0 10px; font-size: 25px; font-weight: 800; letter-spacing: 1.5px; color: var(--pl-ink); }
.pl-brand .pl-sub {
  display: inline-flex; align-items: center; gap: 12px; margin: 0;
  font-size: 13px; letter-spacing: 3px; color: #8593b1;
}
.pl-brand .pl-sub::before,
.pl-brand .pl-sub::after {
  content: ""; width: 22px; height: 1px;
}
.pl-brand .pl-sub::before { background: linear-gradient(90deg, transparent, #c3cee4); }
.pl-brand .pl-sub::after  { background: linear-gradient(90deg, #c3cee4, transparent); }

/* 卡片 */
.pl-card {
  position: relative; background: rgba(255,255,255,.94);
  border: 1px solid rgba(18,30,60,.07);
  border-radius: 22px; padding: 24px 24px 26px;
  box-shadow: 0 30px 70px -28px rgba(23,45,100,.26), 0 4px 14px rgba(23,45,100,.05);
  backdrop-filter: blur(8px);
  animation: plUp .62s .06s cubic-bezier(.22,.8,.28,1) both;
}
.pl-card.shake { animation: plShake .45s ease; }
.pl-server-alert {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; padding: 10px 13px;
  border-radius: 12px; font-size: 13px; line-height: 1.6; color: var(--pl-red);
  background: #fef2f3; border: 1px solid #fbdde0;
}

/* 顶部切换条 */
.pl-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 5px;
  margin: 0 0 20px; background: #eef2f9; border: 1px solid rgba(18,30,60,.05);
  border-radius: 15px; overflow: hidden;
}
.pl-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px);
  border-radius: 11px; background: linear-gradient(135deg, #2f7bff, #23b8ff);
  box-shadow: 0 8px 18px -6px rgba(43,110,255,.5);
  transition: transform .45s cubic-bezier(.34,1.3,.5,1); will-change: transform;
}
.pl-tab {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; border: 0; background: transparent; border-radius: 11px;
  font-weight: 700; font-size: 15px; letter-spacing: 1px; color: #8794b0; cursor: pointer;
  transition: color .3s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.pl-tab i { font-size: 17px; }
.pl-tab:hover { color: #53617f; }
.pl-tab.active { color: #fff; }
.pl-tab:active { transform: scale(.96); }

/* 字段组（折叠动画用 grid-rows） */
.pl-stack {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .5s cubic-bezier(.4,0,.2,1), opacity .32s ease;
}
.pl-stack.collapsed { grid-template-rows: 0fr; opacity: .35; }
.pl-stack-in { min-height: 0; overflow: hidden; visibility: visible; transition: visibility .5s; }
.pl-stack.collapsed .pl-stack-in { visibility: hidden; }

/* 输入框 */
.pl-field { position: relative; display: block; margin-bottom: 13px; }
.pl-field input {
  width: 100%; height: 52px; padding: 0 48px 0 46px; font-size: 16px; color: var(--pl-ink);
  border: 1px solid #dfe6f1; border-radius: 14px; background: #fbfcfe;
  outline: none; transition: border-color .25s ease, background .25s ease, box-shadow .25s ease;
  -webkit-appearance: none; appearance: none;
}
.pl-field input::placeholder { color: #aeb8cd; }
.pl-field input:focus { border-color: var(--pl-blue); background: #fff; box-shadow: 0 0 0 4px rgba(47,123,255,.1); }
.pl-field > i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: #a5b1c9; font-size: 17px; pointer-events: none; transition: color .2s ease;
}
.pl-field:focus-within > i { color: var(--pl-blue); }
.pl-field.error input { border-color: var(--pl-red); background: #fff9fa; box-shadow: 0 0 0 4px rgba(229,72,77,.08); }
.pl-field.error > i { color: var(--pl-red); }
.pl-field.error { animation: plShake .4s ease; }
.pl-eye {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: #a5b1c9; cursor: pointer; transition: color .2s ease, background .2s ease;
}
.pl-eye:hover { color: var(--pl-blue); background: #eef3fd; }
.pl-eye i { pointer-events: none; font-size: 18px; }

/* 提示文字 */
.pl-hint { display: flex; gap: 7px; align-items: flex-start; margin: 0 3px 14px; color: #94a0b8; font-size: 12.5px; line-height: 1.7; }
.pl-hint i { margin-top: 2.5px; font-size: 13px; color: var(--pl-blue); }
.pl-hint-reg i { color: var(--pl-gold); }
.pl-hint-account { display: none; }
.pl-hint-account i { color: var(--pl-green); }
#plForm[data-mode="register"] .pl-hint-account { display: flex; }
#plForm[data-mode="register"] .pl-hint-login { display: none; }

/* 行内错误提示 */
.pl-error {
  display: flex; align-items: center; gap: 6px; overflow: hidden;
  max-height: 0; opacity: 0; margin: 0;
  color: var(--pl-red); font-size: 13px; line-height: 1.5;
  transition: max-height .3s ease, opacity .25s ease, margin .3s ease;
}
.pl-error.show { max-height: 60px; opacity: 1; margin: -2px 3px 12px; }
.pl-error i { flex: none; font-size: 14px; }

/* 提交按钮 */
.pl-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 52px; margin-top: 2px; border: 0; border-radius: 14px;
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 4px; cursor: pointer;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 45%, #23b8ff 130%);
  box-shadow: 0 14px 28px -12px rgba(43,110,255,.55);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease, opacity .2s ease;
}
.pl-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 32px -12px rgba(43,110,255,.6); }
.pl-btn:active:not(:disabled) { transform: translateY(0) scale(.985); }
.pl-btn:disabled { cursor: not-allowed; opacity: .9; }
.pl-btn.loading { filter: saturate(1.12) brightness(1.02); }
.pl-spinner { display: none; width: 18px; height: 18px; flex: none; }
.pl-btn.loading .pl-spinner, .pl-2fa-confirm.loading .pl-spinner { display: inline-block; }
.pl-spinner i {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; animation: plSpin .7s linear infinite;
}
@keyframes plSpin { to { transform: rotate(360deg); } }

/* 页脚 */
.pl-footer {
  margin-top: 20px; text-align: center; font-size: 12.5px; letter-spacing: 1.5px;
  color: rgba(35,52,92,.55);
  animation: plUp .62s .14s cubic-bezier(.22,.8,.28,1) both;
}
.pl-footer i { font-size: 10px; opacity: .7; }

/* 通用遮罩弹窗 */
.pl-mask {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(13,24,51,.32); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility .24s ease;
}
.pl-mask.show { opacity: 1; visibility: visible; }
.pl-dialog {
  width: min(264px, 100%); padding: 22px 20px 18px; border-radius: 18px; text-align: center;
  background: #fff; box-shadow: 0 20px 48px -20px rgba(13,24,51,.28);
  transform: translateY(10px) scale(.96); transition: transform .28s cubic-bezier(.2,.9,.3,1.1);
}
.pl-mask.show .pl-dialog { transform: translateY(0) scale(1); }

/* 成功弹窗 */
.pl-dialog-icon {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #1fc58c; font-size: 26px; background: #e9f8f1;
}
.pl-dialog-title { margin: 0 0 5px; font-size: 17px; font-weight: 800; color: #1d2b4d; }
.pl-dialog-text { margin: 0; font-size: 12.5px; line-height: 1.6; color: #90a0b8; }

/* 管理员二级验证弹窗 */
.pl-2fa-mask { z-index: 3100; }
.pl-2fa-mask .pl-dialog { width: min(330px, 100%); text-align: left; }
.pl-2fa-title {
  display: flex; align-items: center; gap: 9px; margin-bottom: 13px;
  font-size: 17px; font-weight: 800; color: var(--pl-ink);
}
.pl-2fa-title i { color: var(--pl-blue); font-size: 20px; }
.pl-2fa-account {
  display: flex; align-items: center; gap: 9px; margin-bottom: 13px; padding: 10px 13px;
  border-radius: 12px; color: #2a5fd0; font-weight: 600; font-size: 13.5px;
  background: #f0f6ff; border: 1px solid #dbe8fb;
}
.pl-2fa-account i { font-size: 16px; }
.pl-2fa-account em { margin-left: auto; font-style: normal; font-weight: 500; font-size: 12px; color: #8b98b2; }
.pl-2fa-err.show { margin: -2px 0 10px; }
.pl-2fa-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 2px; }
.pl-2fa-cancel {
  height: 42px; padding: 0 20px; border: 1px solid #dfe6f1; border-radius: 12px;
  background: #fff; color: #6a7794; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.pl-2fa-cancel:hover { background: #f3f6fb; color: #45536f; }
.pl-2fa-confirm {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; min-width: 108px; padding: 0 20px; border: 0; border-radius: 12px;
  color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #23b8ff);
  box-shadow: 0 10px 22px -10px rgba(43,110,255,.55);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.pl-2fa-confirm:hover { transform: translateY(-1px); }
.pl-2fa-confirm:disabled { cursor: not-allowed; opacity: .8; }

/* 动画 */
@keyframes plUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes plShake { 10%,90% { transform: translateX(-1px); } 20%,80% { transform: translateX(2px); } 30%,50%,70% { transform: translateX(-4px); } 40%,60% { transform: translateX(4px); } }

/* 手机适配 */
@media (max-width: 480px) {
  .pear-login { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); }
  .pl-brand { margin-bottom: 20px; }
  .pl-brand h1 { font-size: 22px; }
  .pl-logo { width: 58px; height: 58px; border-radius: 18px; font-size: 27px; }
  .pl-card { padding: 20px 18px 22px; border-radius: 20px; }
  .pl-tab { height: 44px; }
  .pl-field input { height: 50px; }
  .pl-btn { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .pear-login *, .pear-login *::before, .pear-login *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
}