/* =========================================================
   Roblox 群管理后台 · 登录页
   基础布局沿用 test.astudlox.top（全屏居中卡片 + #/login 路由）
   视觉参考 www.langu.pw/login（深色氛围背景 / 玻璃卡片 / 居中品牌）
   ========================================================= */

:root {
  --bg: #08110e;
  --ink: #eef4ee;
  --ink-soft: rgba(238, 244, 238, .66);
  --ink-faint: rgba(238, 244, 238, .44);
  --line: rgba(222, 232, 228, .16);
  --line-soft: rgba(255, 255, 255, .08);
  --gold: rgba(194, 146, 46, .55);
  --qq: #12b7f5;
  --qq-deep: #0a8fd4;
  --danger: #ffbcbc;
  --radius-card: 22px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { border: 0; }

/* ---------------- 初始路由骨架 ---------------- */
.app-root { min-height: 100vh; }

.route-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(238, 244, 238, .5);
}

.route-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--qq);
  box-shadow: 0 0 14px rgba(18, 183, 245, .8);
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.route-loading-label {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.82); }
}

/* ---------------- 页面与滚动背景 ---------------- */
.login-page {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(16px, 4vw, 32px);
  padding-top: max(clamp(16px, 4vw, 32px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 4vw, 32px), env(safe-area-inset-bottom));
  overflow: hidden;
  background: #0a0a12;
}

/* roblox 同款无缝循环背景：两段相同 cell + translateX(-50%)（与 test.astudlox.top 一致） */
.login-banner {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #0a0a12;
  animation: login-bg-in 1.1s ease-out both;
}

.login-banner-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  width: calc(200vh * 3.89);            /* 两个 cell，各 = 图片等比渲染宽（2334/600 ≈ 3.89） */
  animation: login-banner-loop 120s linear infinite;
  will-change: transform;
}

.login-banner-cell {
  flex: none;
  width: calc(100vh * 3.89);
  height: 100%;
  background: url('/assets/login-bg.jpg') repeat-x top left / auto 100%;
}

.login-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .70) 0%, rgba(0, 0, 0, .50) 100%);
}

@keyframes login-banner-loop {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes login-bg-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------- 卡片 ---------------- */
.login-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  animation: stage-in .8s cubic-bezier(.16, 1, .3, 1) backwards;
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 408px;
  padding: 34px 32px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: linear-gradient(150deg, rgba(30, 42, 36, .90) 0%, rgba(16, 23, 19, .82) 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, .35),
    0 28px 72px -30px rgba(0, 0, 0, .78),
    inset 0 1px 0 rgba(255, 255, 255, .07);
  -webkit-backdrop-filter: blur(20px) saturate(115%);
  backdrop-filter: blur(20px) saturate(115%);
  overflow: hidden;
  animation: card-in .7s cubic-bezier(.16, 1, .3, 1) backwards;
  transition: transform .4s cubic-bezier(.16, 1, .3, 1), box-shadow .4s cubic-bezier(.16, 1, .3, 1);
}

/* 顶部内高光 */
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .34), transparent);
  pointer-events: none;
}

/* 卡片内顶部柔光 */
.login-card::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -120px;
  width: 320px;
  height: 240px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(18, 183, 245, .10), transparent 70%);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .login-card:hover {
    transform: translateY(-3px);
    box-shadow:
      0 3px 10px rgba(0, 0, 0, .42),
      0 32px 80px -30px rgba(0, 0, 0, .85),
      inset 0 1px 0 rgba(255, 255, 255, .09);
  }
}

.login-card.is-shaking { animation: card-shake .45s cubic-bezier(.36, .07, .19, .97) both; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes stage-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ---------------- 头部品牌 ---------------- */
.login-head {
  position: relative;
  text-align: center;
  margin-bottom: 26px;
  animation: rise-in .6s cubic-bezier(.16, 1, .3, 1) backwards;
  animation-delay: .08s;
}

.login-logo {
  position: relative;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid rgba(226, 184, 80, .32);
  background: linear-gradient(140deg, rgba(15, 118, 110, .30), rgba(10, 20, 16, .55));
  box-shadow:
    0 14px 34px -14px rgba(15, 118, 110, .75),
    inset 0 1px 0 rgba(255, 255, 255, .10);
}

.login-logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 22px;
  border: 1px solid rgba(226, 184, 80, .14);
  pointer-events: none;
}

.login-logo img {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 12px;
}

.login-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #f4f8f4;
}

.login-subtitle {
  margin: 8px 0 0;
  font-size: .8rem;
  line-height: 1.5;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* ---------------- 登录主体 ---------------- */
.login-body {
  position: relative;
  display: grid;
  gap: 14px;
  animation: rise-in .6s cubic-bezier(.16, 1, .3, 1) backwards;
  animation-delay: .18s;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* QQ 互联按钮 */
.qq-login-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 13px;
  background: linear-gradient(135deg, #35c8ff 0%, #12b7f5 46%, #0990d6 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow:
    0 16px 34px -16px rgba(18, 183, 245, .80),
    inset 0 1px 0 rgba(255, 255, 255, .30);
  transition: transform .18s ease, box-shadow .25s ease, filter .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .qq-login-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow:
      0 20px 40px -16px rgba(18, 183, 245, .90),
      inset 0 1px 0 rgba(255, 255, 255, .34);
  }
}

.qq-login-btn:active {
  transform: translateY(1px) scale(.992);
  box-shadow: 0 8px 20px -12px rgba(18, 183, 245, .75);
}

.qq-login-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .7);
  outline-offset: 3px;
}

.qq-login-btn:disabled {
  cursor: not-allowed;
  opacity: .78;
  transform: none;
  filter: saturate(.9);
}

.qq-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  color: var(--qq);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: -.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

.qq-spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, .40);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.qq-login-btn.is-loading .qq-spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* 安全提示 */
.login-safe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.login-safe svg {
  width: 14px;
  height: 14px;
  flex: none;
  color: rgba(52, 211, 153, .85);
}

/* 提示 / 错误 */
.login-alert {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  word-break: break-word;
  animation: alert-in .35s cubic-bezier(.16, 1, .3, 1) both;
}

.login-alert.is-error {
  color: var(--danger);
  background: rgba(255, 90, 90, .11);
  border-color: rgba(255, 120, 120, .32);
}

.login-alert.is-info {
  color: #aee6ff;
  background: rgba(18, 183, 245, .10);
  border-color: rgba(18, 183, 245, .30);
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* 说明文案 */
.login-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
  text-align: center;
  color: var(--ink-faint);
}

/* ---------------- 卡片底部：备案号 ---------------- */
.login-filing {
  position: relative;
  margin: 26px -32px 0;
  padding: 15px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 9px;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .14);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

.filing-link {
  display: inline-flex;
  align-items: center;
  color: rgba(238, 244, 238, .50);
  text-decoration: none;
  transition: color .2s ease;
}

.filing-link:hover,
.filing-link:focus-visible { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.filing-link img {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  border-radius: 2px;
  opacity: .9;
}

.filing-dot { color: rgba(255, 255, 255, .22); }

/* ---------------- 跳转授权遮罩 ---------------- */
.jump-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 9, 7, .62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: stage-in .3s ease both;
}

.jump-card {
  min-width: 260px;
  padding: 28px 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(28, 39, 34, .96), rgba(14, 21, 17, .94));
  box-shadow: 0 26px 60px -26px rgba(0, 0, 0, .8);
}

.jump-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 16px;
  border: 2.5px solid rgba(18, 183, 245, .25);
  border-top-color: var(--qq);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.jump-title { margin: 0; font-size: 15px; font-weight: 600; color: #f2f7f2; }
.jump-desc { margin: 6px 0 0; font-size: 12px; color: var(--ink-faint); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 460px) {
  .login-card { padding: 28px 20px 0; border-radius: 18px; }
  .login-logo { width: 52px; height: 52px; margin-bottom: 16px; }
  .login-logo img { width: 38px; height: 38px; }
  .login-title { font-size: 1.28rem; }
  .login-subtitle { margin-top: 6px; font-size: .76rem; }
  .login-head { margin-bottom: 22px; }
  .qq-login-btn { height: 50px; font-size: 14.5px; border-radius: 12px; }
  .login-filing { margin: 22px -20px 0; padding: 14px 12px calc(15px + env(safe-area-inset-bottom, 0px)); gap: 4px 8px; font-size: 11px; }
  .filing-link img { width: 13px; height: 13px; }
}

@media (max-width: 360px) {
  .login-page { padding-left: 12px; padding-right: 12px; }
  .login-card { padding: 24px 16px 0; }
  .login-filing { margin-left: -16px; margin-right: -16px; }
  .login-subtitle { font-size: .72rem; }
}

@media (max-height: 660px) {
  .login-card { padding-top: 22px; }
  .login-head { margin-bottom: 18px; }
  .login-logo { width: 46px; height: 46px; margin-bottom: 12px; }
  .login-logo img { width: 34px; height: 34px; }
  .login-logo::after { display: none; }
  .login-title { font-size: 1.24rem; }
  .login-subtitle { margin-top: 5px; }
  .login-filing { margin-top: 18px; padding-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ambient-orb { animation: none; }
  .login-banner-track { animation: none; width: 100%; }
  .login-banner-cell { width: 100%; background-size: cover; background-position: center; }
}
