/* ============================================================
   login.css — 登录视图
   上半：像素画封面（trae 风格：黑底 + 白/蓝随机像素、动态乱动）
   下半：慢扫描电视（SSTV）内的 CRT 绿色终端（NO.06），
         PowerShell 风格提示符；背景与光标采用工程蓝图 HUD（NO.10）
   ============================================================ */

/* ---------- 登录视图容器：上下两屏（翻页 = 内部页面整体上移） ----------
   外层 .login-view 固定视口、overflow:clip 裁切；
   内层 .login-pages 高 200vh，翻页时 translateY 上移 100vh。 */
.login-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  overflow: clip;
}
.login-pages {
  width: 100%;
  height: 200vh;
  display: flex;
  flex-direction: column;
  transition: transform 1.45s cubic-bezier(.3, .85, .25, 1);
  will-change: transform;
}
.login-view.is-flipped .login-pages { transform: translateY(-100vh); }

/* ================= 上半 · 像素封面 ================= */
.cover-screen {
  position: relative;
  flex: none;
  height: 100vh;
  background: #000;
  overflow: hidden;
  user-select: none;
}
.pixel-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cover-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: overlay;
  background-image:
    radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    radial-gradient(rgba(77, 159, 255, .05) 1px, transparent 1px);
  background-size: 7px 7px, 13px 13px;
  background-position: 0 0, 4px 6px;
  animation: coverNoise 0.9s steps(4) infinite;
}
@keyframes coverNoise {
  0% { background-position: 0 0, 4px 6px; }
  25% { background-position: -5px 3px, 9px -2px; }
  50% { background-position: 3px -5px, -6px 8px; }
  75% { background-position: -2px 6px, 2px -7px; }
  100% { background-position: 0 0, 4px 6px; }
}

.cover-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 40px;
  z-index: 4;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .9);
}
.cover-top-tag { color: #7ec9ff; letter-spacing: .3em; }

.cover-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  padding: 0 48px 52px;
  z-index: 3;
}
.cover-brand { max-width: 780px; }
.cover-name {
  font-size: clamp(44px, 6.4vw, 92px);
  font-weight: 800;
  letter-spacing: .05em;
  color: #fff;
  line-height: 1.08;
  text-shadow: 0 0 26px rgba(77, 159, 255, .35);
}
.cover-en {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 15px);
  letter-spacing: .34em;
  color: rgba(255, 255, 255, .66);
}
.cover-keywords {
  margin-top: 14px;
  font-size: clamp(15px, 1.6vw, 20px);
  letter-spacing: .3em;
  color: #9cc7ff;
}
.cover-keywords::before {
  content: "";
  display: inline-block;
  width: 34px; height: 3px;
  margin-right: 14px;
  background: var(--accent-blue);
  vertical-align: middle;
}

.cover-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}
.btn-cover {
  min-width: 168px;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .12em;
  border: 1px solid transparent;
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, color .22s ease;
}
.btn-cover-primary {
  background: #2f7bff;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18) inset, 0 12px 36px rgba(47, 123, 255, .42);
}
.btn-cover-primary:hover {
  transform: translateY(-2px);
  background: #3c86ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .24) inset, 0 16px 44px rgba(47, 123, 255, .55);
}
.btn-cover-ghost {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .5);
  color: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
}
.btn-cover-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, .16);
  border-color: #fff;
}

.cover-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(255, 255, 255, .35);
  z-index: 4;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .9);
  animation: hintPulse 2.4s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }

/* ================= 下半 · 慢扫描电视终端 ================= */
.login-screen {
  position: relative;
  flex: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #020608;
  padding: 40px 24px;
}

.sstv-frame {
  position: relative;
  width: min(1080px, 100%);
  border-radius: 22px;
  padding: 26px;
  background:
    linear-gradient(160deg, #1d2733 0%, #0b1118 55%, #141d28 100%);
  border: 1px solid rgba(160, 200, 255, .2);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .75),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
.sstv-screen {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--crt-bg);
  min-height: 430px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .85), 0 0 0 1px rgba(140, 200, 255, .18);
}

/* --- 蓝图 HUD 背景（NO.10：网格 + 坐标 + 角标） --- */
.bp-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bp-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-line) 1px, transparent 1px),
    linear-gradient(rgba(120, 190, 255, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 190, 255, .14) 1px, transparent 1px);
  background-size: 90px 90px, 90px 90px, 18px 18px, 18px 18px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  opacity: .5;
}
.bp-hud::before, .bp-hud::after {
  content: "";
  position: absolute;
  width: 190px; height: 26px;
  background-image:
    linear-gradient(90deg, transparent 0 22px, var(--bp-cyan) 22px 24px, transparent 24px),
    linear-gradient(0deg, transparent 0 22px, var(--bp-cyan) 22px 24px, transparent 24px);
  opacity: .55;
}
.bp-hud::before { top: 14px; right: 14px; }
.bp-hud::after {
  bottom: 14px; left: 14px;
  transform: rotate(180deg);
}

/* 十字准星光标（跟随鼠标） */
.xhair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.xhair .xh-v, .xhair .xh-h {
  position: absolute;
  background: rgba(126, 201, 255, .28);
}
.xhair .xh-v { top: 0; bottom: 0; width: 1px; }
.xhair .xh-h { left: 0; right: 0; height: 1px; }
.xhair .xh-dot {
  position: absolute;
  width: 22px; height: 22px;
  border: 1.5px solid var(--bp-cyan);
  border-radius: 3px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px rgba(126, 201, 255, .5);
}

/* CRT 扫描线（保留背景扫描：慢扫描电视风格） */
.crt-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0 2px,
    rgba(0, 0, 0, .32) 2px 4px
  );
  mix-blend-mode: multiply;
  opacity: .65;
}
.crt-scan::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(77, 255, 136, .045), rgba(77, 255, 136, .09), rgba(77, 255, 136, .045), transparent);
  animation: sstvRoll 7s linear infinite;
}
@keyframes sstvRoll {
  0% { top: -100px; }
  100% { top: 110%; }
}

/* 慢扫描电视：画面整体缓缓下移的“追踪带” */
.sstv-roll {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  mix-blend-mode: screen;
  background:
    linear-gradient(180deg, transparent 0%, rgba(77, 255, 136, .05) 44%, rgba(77, 255, 136, .12) 50%, rgba(77, 255, 136, .05) 56%, transparent 100%);
  background-size: 100% 380px;
  background-repeat: no-repeat;
  background-position: center -200px;
  animation: sstvBand 5.2s linear infinite;
  opacity: .8;
}
@keyframes sstvBand {
  0% { background-position: center -200px; }
  100% { background-position: center 145%; }
}

/* --- 终端（NO.06 绿色 CRT + PowerShell 样式） --- */
.terminal {
  position: relative;
  z-index: 8;
  min-height: 430px;
  padding: 34px 44px 30px;
  font-family: var(--font-mono);
  color: var(--crt-green);
  text-shadow: 0 0 7px rgba(77, 255, 136, .55);
  display: flex;
  flex-direction: column;
}
.term-log {
  flex: 1;
  min-height: 150px;
  font-size: 13.5px;
  line-height: 1.85;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
}
.term-log .tl-line { animation: tlIn .06s steps(2) both; }
.term-log .tl-sys { color: rgba(126, 201, 255, .85); }
.term-log .tl-env { color: var(--crt-green); }
.term-log .tl-dim { color: rgba(77, 255, 136, .5); }
.term-log .tl-clr { color: var(--bp-amber); }
@keyframes tlIn { from { opacity: 0; } to { opacity: 1; } }

.term-form { margin-top: 18px; }
.term-prompt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.term-prompt {
  flex: none;
  font-size: 13.5px;
  color: #a8e6ff;
  text-shadow: 0 0 6px rgba(126, 201, 255, .55);
}
.term-field { flex: 1; display: block; }
.term-input {
  width: 100%;
  background: rgba(77, 255, 136, .045);
  border: 1px solid rgba(77, 255, 136, .38);
  border-radius: 4px;
  color: var(--crt-green);
  font-family: var(--font-mono);
  font-size: 14.5px;
  padding: 10px 13px;
  caret-color: var(--crt-green);
  text-shadow: 0 0 6px rgba(77, 255, 136, .5);
  outline: none;
}
.term-input::placeholder { color: rgba(77, 255, 136, .38); }
.term-input:focus {
  border-color: var(--crt-green);
  box-shadow: 0 0 0 1px rgba(77, 255, 136, .35), 0 0 18px rgba(77, 255, 136, .18);
}

.term-error {
  min-height: 20px;
  font-size: 12.5px;
  color: #ff7d7d;
  text-shadow: 0 0 7px rgba(255, 93, 93, .5);
  letter-spacing: .05em;
}
.term-actions { display: flex; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.term-btn {
  flex: 1;
  min-width: 150px;
  padding: 12px 18px;
  background: rgba(77, 255, 136, .06);
  border: 1px solid rgba(77, 255, 136, .45);
  border-radius: 4px;
  color: var(--crt-green);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .08em;
  text-shadow: 0 0 6px rgba(77, 255, 136, .5);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.term-btn:hover {
  background: rgba(77, 255, 136, .14);
  box-shadow: 0 0 24px rgba(77, 255, 136, .28);
  transform: translateY(-1px);
}
.term-btn-primary {
  background: rgba(77, 255, 136, .18);
  border-color: var(--crt-green);
  font-weight: 700;
}
/* 游客会话下锁定"游客登录"入口：不明显颜色 + 不可点击 */
.term-btn.locked, .term-btn:disabled {
  background: rgba(77, 255, 136, .03);
  border-color: rgba(77, 255, 136, .14);
  color: rgba(77, 255, 136, .28);
  text-shadow: none;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.term-btn.locked:hover, .term-btn:disabled:hover {
  background: rgba(77, 255, 136, .03);
  box-shadow: none;
  transform: none;
}
.term-note {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.7;
  color: rgba(77, 255, 136, .5);
  border-top: 1px dashed rgba(77, 255, 136, .28);
  padding-top: 12px;
}

.sstv-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: rgba(160, 200, 255, .55);
}
.sstv-meta #sstv-status { color: rgba(77, 255, 136, .7); }

/* ---------- 限位提示（上翻时网页内提醒） ---------- */
.login-limit-hint {
  position: fixed;
  left: 50%;
  top: 22px;
  transform: translate(-50%, -90px);
  z-index: 120;
  background: rgba(4, 16, 10, .95);
  border: 1px solid rgba(77, 255, 136, .5);
  color: var(--crt-green);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .12em;
  padding: 10px 22px;
  border-radius: 99px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6), 0 0 24px rgba(77, 255, 136, .22);
  transition: transform .45s cubic-bezier(.2, .9, .3, 1);
  pointer-events: none;
  white-space: nowrap;
}
.login-limit-hint.show { transform: translate(-50%, 0); }
.login-limit-hint .llh-icon { color: var(--bp-amber); margin-right: 8px; }

@media (max-width: 760px) {
  .cover-bottom { flex-direction: column; align-items: flex-start; gap: 26px; padding: 0 24px 40px; }
  .cover-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .btn-cover { width: 100%; }
  .cover-top { padding: 20px 24px; }
  .terminal { padding: 24px 20px 22px; }
  .term-actions { flex-direction: column; }
}
