/* 授权登录页 —— 视觉参考跑跑一起赚 H5 登录页（Login.vue），仅样式层，交互由 login.js 驱动 */
.login-page {
  --primary: #667eea;
  --primary-deep: #5a67d8;
  --secondary: #764ba2;
  --violet: #a78bfa;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --green: #10b981;
  --red: #ef4444;
  --surface: #eef0f8;
  --qr-size: 234px;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
}

.login-page *, .login-page *::before, .login-page *::after { box-sizing: border-box; }
.login-page [hidden] { display: none !important; }
.login-page button, .login-page input { font: inherit; }
.login-page button { cursor: pointer; }
.login-page ::selection { color: #fff; background: #667eea; }
.login-page button:focus-visible { outline: 3px solid rgba(102, 126, 234, .55); outline-offset: 3px; }

.icon-sprite { position: absolute; overflow: hidden; pointer-events: none; }
.icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.login-shell { display: flex; min-height: 100vh; min-height: 100svh; }

/* ========== 左侧装饰区 ========== */
.decoration-panel {
  position: relative;
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #5a67d8 0%, #667eea 30%, #764ba2 100%);
}

.decoration-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; }

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.bg-orb { position: absolute; border-radius: 50%; filter: blur(40px); }
.orb-1 {
  width: 350px; height: 350px; top: -80px; right: -80px;
  background: radial-gradient(circle, rgba(168, 139, 250, .4), transparent 70%);
  animation: orb-float-1 12s ease-in-out infinite;
}
.orb-2 {
  width: 280px; height: 280px; bottom: -60px; left: -60px;
  background: radial-gradient(circle, rgba(129, 236, 236, .25), transparent 70%);
  animation: orb-float-2 14s ease-in-out infinite;
}
.orb-3 {
  width: 180px; height: 180px; top: 40%; left: 60%;
  background: radial-gradient(circle, rgba(236, 121, 159, .2), transparent 70%);
  animation: orb-float-3 10s ease-in-out infinite;
}
.orb-4 {
  width: 120px; height: 120px; top: 70%; left: 30%;
  background: radial-gradient(circle, rgba(255, 237, 130, .15), transparent 70%);
  animation: orb-float-1 16s ease-in-out infinite 2s;
}

.decoration-content {
  position: relative;
  z-index: 2;
  max-width: 420px;
  padding: 60px 40px;
  color: #fff;
  text-align: center;
}

.logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 28px;
  animation: fade-up .7s ease-out both;
}
.logo-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .3), transparent 60%);
  animation: glow-pulse 3s ease-in-out infinite;
}
.logo-icon {
  position: relative;
  display: grid;
  width: 80px;
  height: 80px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 24px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .15);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.logo-icon .icon { width: 52px; height: 52px; stroke-width: 1.5; }

.app-name {
  margin: 0 0 12px;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  animation: fade-up .7s ease-out .15s both;
}
.gradient-text {
  background: linear-gradient(90deg, #fff, #c4b5fd, #fff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}
.app-desc {
  margin: 0 0 44px;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  opacity: .85;
  animation: fade-up .7s ease-out .3s both;
}

.feature-list { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 40px;
  font-size: .95rem;
  background: rgba(255, 255, 255, .08);
  opacity: 0;
  transition: background .3s ease, transform .3s ease, border-color .3s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: feature-in .6s ease-out var(--delay, 0s) forwards;
}
.feature-item:hover {
  border-color: rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .14);
  transform: translateX(4px);
}
.feature-icon { display: grid; width: 25px; height: 25px; place-items: center; }
.feature-icon .icon { width: 22px; height: 22px; stroke-width: 1.6; }

.deco-line {
  width: 60px;
  height: 2px;
  margin: 44px auto 16px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: line-expand 1s ease-out .8s both;
}
.deco-footer {
  margin: 0;
  font-size: .75rem;
  letter-spacing: .05em;
  opacity: .5;
  animation: fade-up .7s ease-out 1s both;
}

/* ========== 右侧登录面板 ========== */
.login-panel {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #eef0f8 0%, #e4e7f5 40%, #eae6f5 100%);
}

.panel-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.panel-blob { position: absolute; border-radius: 50%; filter: blur(50px); }
.blob-a {
  width: 300px; height: 300px; top: 5%; right: -50px;
  background: radial-gradient(circle, rgba(102, 126, 234, .18), transparent 70%);
  animation: blob-move-1 18s ease-in-out infinite;
}
.blob-b {
  width: 260px; height: 260px; bottom: 0; left: -40px;
  background: radial-gradient(circle, rgba(168, 139, 250, .15), transparent 70%);
  animation: blob-move-2 22s ease-in-out infinite;
}
.blob-c {
  width: 200px; height: 200px; top: 50%; left: 40%;
  background: radial-gradient(circle, rgba(129, 236, 236, .1), transparent 70%);
  animation: blob-move-1 16s ease-in-out infinite 3s;
}

.login-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  animation: card-in .6s cubic-bezier(.16, 1, .3, 1) both;
}

.card-border-glow {
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(102, 126, 234, .5), rgba(168, 139, 250, .3), rgba(102, 126, 234, .5));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
}

.card-inner {
  position: relative;
  padding: 40px 24px;
  border-radius: inherit;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.login-logo { position: relative; display: flex; justify-content: center; margin-bottom: 20px; }
.logo-badge {
  position: relative;
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 8px 24px rgba(102, 126, 234, .25);
}
.logo-badge .icon { width: 40px; height: 40px; stroke-width: 1.6; }

.login-header { margin-bottom: 30px; text-align: center; }
.login-header h2 {
  margin: 0 0 10px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #1a1a2e, #4c1d95);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-divider {
  width: 36px;
  height: 3px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, #667eea, #a78bfa);
  animation: divider-grow .8s ease-out .3s both;
}
.login-header p { margin: 0; font-size: .9rem; color: var(--muted-2); }

/* ========== 提示条 ========== */
.notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: .82rem;
  line-height: 1.6;
}
.notice.error { color: #b42318; border-color: #fbd5d0; background: #fef3f2; }
.notice.success { color: #047857; border-color: #c7f0dd; background: #ecfdf5; }

/* ========== 二维码区域 ========== */
.qrcode-area { display: flex; justify-content: center; min-height: 300px; }

.qr-login { display: flex; width: 100%; flex-direction: column; align-items: center; }

.qrcode-wrapper { position: relative; width: var(--qr-size); height: var(--qr-size); }

.qrcode-glow {
  position: absolute;
  inset: -12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(102, 126, 234, .15), rgba(168, 139, 250, .1));
  filter: blur(16px);
  animation: glow-breath 3s ease-in-out infinite;
}

.qrcode-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 9px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(102, 126, 234, .12);
}
.qrcode-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: none;
  height: 3px;
  background: linear-gradient(90deg, transparent, #667eea, #a78bfa, #667eea, transparent);
  box-shadow: 0 0 12px rgba(102, 126, 234, .6);
}
.qr-login[data-state="waiting"] .scan-line { display: block; animation: scan-move 2.5s ease-in-out infinite; }

.corner {
  position: absolute;
  z-index: 3;
  width: 24px;
  height: 24px;
  border: 3px solid var(--primary);
  pointer-events: none;
  transition: border-color .3s;
}
.corner-tl { top: -6px; left: -6px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.corner-tr { top: -6px; right: -6px; border-bottom: none; border-left: none; border-radius: 0 8px 0 0; }
.corner-bl { bottom: -6px; left: -6px; border-top: none; border-right: none; border-radius: 0 0 0 8px; }
.corner-br { right: -6px; bottom: -6px; border-top: none; border-left: none; border-radius: 0 0 8px 0; }
.qr-login[data-state="expired"] .corner, .qr-login[data-state="error"] .corner { border-color: var(--muted-2); }
.qr-login[data-state="confirmed"] .corner { border-color: var(--green); }

/* 遮罩层：loading / expired / error / confirmed 时覆盖二维码 */
.qr-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
  color: #374151;
  font-size: .9rem;
  text-align: center;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.qr-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1.5px solid rgba(102, 126, 234, .25);
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  animation: symbol-pulse 1.8s ease-in-out infinite;
}
.qr-symbol .icon { width: 26px; height: 26px; stroke-width: 1.6; }

.loading-dots { display: none; gap: 8px; margin-top: 2px; }
.loading-dots > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.loading-dots > span:nth-child(2) { animation-delay: .15s; }
.loading-dots > span:nth-child(3) { animation-delay: .3s; }
.qr-login[data-state="loading"] .loading-dots { display: flex; }

.qr-login[data-state="expired"] .qr-symbol,
.qr-login[data-state="error"] .qr-symbol { border-color: rgba(156, 163, 175, .35); color: var(--muted-2); animation: none; }
.qr-login[data-state="expired"] .qrcode-frame img,
.qr-login[data-state="error"] .qrcode-frame img { filter: blur(4px); opacity: .32; }
.qr-login[data-state="confirmed"] .qrcode-frame img { opacity: .18; }
.qr-login[data-state="expired"] .qr-overlay,
.qr-login[data-state="error"] .qr-overlay { color: #6b7280; }
.qr-login[data-state="confirmed"] .qr-symbol {
  border-color: rgba(16, 185, 129, .3);
  color: var(--green);
  animation: bounce-in .6s cubic-bezier(.175, .885, .32, 1.275);
}
.qr-login[data-state="confirmed"] .qr-overlay { color: var(--green); font-weight: 600; }

/* 状态提示条 */
.qrcode-tips {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 16px;
  border: 1px solid rgba(102, 126, 234, .08);
  border-radius: 12px;
  background: linear-gradient(135deg, #f5f6fa, #eef0f8);
}
.tip-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: dot-pulse 1.5s ease-in-out infinite;
}
.tip-copy { min-width: 0; }
.qr-status { margin: 0; color: #4b5563; font-size: .85rem; font-weight: 600; line-height: 1.5; }
.qr-hint { margin: 3px 0 0; color: var(--muted-2); font-size: .78rem; line-height: 1.5; }

.qr-login[data-state="waiting"] .tip-dot { background: var(--primary); }
.qr-login[data-state="confirmed"] .tip-dot { background: var(--green); animation: none; }
.qr-login[data-state="expired"] .tip-dot,
.qr-login[data-state="error"] .tip-dot { background: var(--muted-2); animation: none; }
.qr-login[data-state="expired"] .qr-status,
.qr-login[data-state="error"] .qr-status { color: #b42318; }

/* 刷新按钮 */
.refresh-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  padding: 13px 24px;
  border: none;
  border-radius: 40px;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 14px rgba(102, 126, 234, .35);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .25s, box-shadow .25s, opacity .2s;
}
.refresh-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(102, 126, 234, .45);
}
.refresh-btn:active:not(:disabled) { transform: translateY(0) scale(1); }
.refresh-btn:disabled { cursor: wait; opacity: .6; box-shadow: none; }

.account-help { margin: 18px 0 0; color: var(--muted-2); font-size: .75rem; line-height: 1.7; text-align: center; }

/* ========== 动画 ========== */
@keyframes orb-float-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.1); }
}
@keyframes orb-float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-25px, -30px) scale(1.08); }
}
@keyframes orb-float-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 25px) scale(1.12); }
}
@keyframes blob-move-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.1); }
}
@keyframes blob-move-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(25px, -30px) scale(1.08); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50% { opacity: .8; transform: scale(1.15); }
}
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes feature-in {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: .92; transform: translateY(0); }
}
@keyframes line-expand {
  from { width: 0; opacity: 0; }
  to { width: 60px; opacity: 1; }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(30px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes divider-grow {
  from { width: 0; opacity: 0; }
  to { width: 36px; opacity: 1; }
}
@keyframes glow-breath {
  0%, 100% { opacity: .6; }
  50% { opacity: 1; }
}
@keyframes scan-move {
  0% { top: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: calc(100% - 3px); opacity: 0; }
}
@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-10px); opacity: 1; }
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(102, 126, 234, .4); }
  50% { opacity: .7; box-shadow: 0 0 0 6px rgba(102, 126, 234, 0); }
}
@keyframes symbol-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, .16); }
  50% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}
@keyframes bounce-in {
  0% { opacity: 0; transform: scale(.3); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
  .decoration-panel { display: flex; }
  .login-panel { padding: 40px; }
  .login-card { min-height: auto; border-radius: 24px; }
  .card-border-glow { opacity: 1; }
  .card-inner {
    padding: 44px 40px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 24px;
    box-shadow: 0 20px 60px -12px rgba(102, 126, 234, .18), 0 4px 16px rgba(0, 0, 0, .04);
  }
}

@media (min-width: 1024px) {
  .login-panel { padding: 60px; }
}

/* 矮屏笔记本：压缩纵向间距，保证二维码完整可见 */
@media (min-width: 768px) and (max-height: 780px) {
  .decoration-content { padding: 40px; }
  .logo-wrap { margin-bottom: 20px; }
  .app-desc { margin-bottom: 32px; }
  .feature-list { gap: 12px; }
  .feature-item { padding: 10px 20px; }
  .deco-line { margin: 30px auto 14px; }
  .card-inner { padding: 32px 36px; }
  .login-logo { margin-bottom: 14px; }
  .login-header { margin-bottom: 22px; }
  .qrcode-area { min-height: 268px; }
  .qrcode-tips { margin-top: 18px; }
  .refresh-btn { margin-top: 14px; }
  .account-help { margin-top: 14px; }
}

/* 手机上让白色卡片铺满整屏，避免上下露出装饰渐变 */
@media (max-width: 767px) {
  .card-inner {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 420px) {
  .card-inner { padding: 34px 18px; }
  .login-header h2 { font-size: 1.55rem; }
  .login-header { margin-bottom: 24px; }
  .qrcode-area { min-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-page *, .login-page *::before, .login-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
