/**
 * 权限认证界面样式
 * 现代化的登录/注册界面 - 流星版
 */

/* 遮罩层 */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0c0d13 0%, #1a1a2e 30%, #16213e 60%, #0f3460 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
  overflow: hidden;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 背景星云装饰 */
#auth-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 10% 20%, rgba(120, 119, 198, 0.25) 0%, transparent 40%),
    radial-gradient(ellipse at 90% 80%, rgba(255, 119, 198, 0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(100, 200, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* 闪烁星星背景 */
#auth-overlay::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(1px 1px at 10% 10%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 30% 15%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(255,255,255,0.5), transparent),
    radial-gradient(2px 2px at 55% 25%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 60% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 80% 70%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 95% 55%, rgba(255,255,255,0.6), transparent);
  background-size: 100% 100%;
  animation: twinkleStars 3s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes twinkleStars {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ============ 烟花画布 ============ */
.fireworks-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ============ 流星容器 ============ */
.meteor-shower {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

/* 流星样式 */
.meteor {
  position: absolute;
  width: 2px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8), rgba(180, 200, 255, 1));
  border-radius: 50%;
  transform: rotate(-45deg);
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(180, 200, 255, 0.8));
}

/* 流星头部光晕 */
.meteor::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 
    0 0 10px 2px rgba(255, 255, 255, 0.9),
    0 0 20px 4px rgba(180, 200, 255, 0.6),
    0 0 30px 6px rgba(120, 150, 255, 0.4);
}

/* 流星尾巴粒子 */
.meteor::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 120px;
  background: linear-gradient(to top, rgba(180, 200, 255, 0.3), transparent);
}

/* 各个流星的动画 */
.meteor:nth-child(1) {
  top: -10%;
  left: 20%;
  animation: meteorFall 3s ease-in 1s infinite;
}

.meteor:nth-child(2) {
  top: -10%;
  left: 50%;
  height: 100px;
  animation: meteorFall 4s ease-in 2.5s infinite;
}

.meteor:nth-child(3) {
  top: -10%;
  left: 75%;
  height: 60px;
  animation: meteorFall 3.5s ease-in 0.5s infinite;
}

.meteor:nth-child(4) {
  top: -10%;
  left: 35%;
  height: 90px;
  animation: meteorFall 4.5s ease-in 4s infinite;
}

.meteor:nth-child(5) {
  top: -10%;
  left: 85%;
  height: 70px;
  animation: meteorFall 3s ease-in 3s infinite;
}

.meteor:nth-child(6) {
  top: -10%;
  left: 10%;
  height: 110px;
  animation: meteorFall 5s ease-in 5.5s infinite;
}

.meteor:nth-child(7) {
  top: -10%;
  left: 60%;
  height: 50px;
  animation: meteorFall 2.5s ease-in 1.5s infinite;
}

.meteor:nth-child(8) {
  top: -10%;
  left: 95%;
  height: 85px;
  animation: meteorFall 4s ease-in 6s infinite;
}

@keyframes meteorFall {
  0% {
    opacity: 0;
    transform: rotate(-45deg) translateY(0);
  }
  5% {
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(-45deg) translateY(calc(100vh + 200px));
  }
}

/* ============ 浮动光球 ============ */
.floating-orbs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
  animation: floatOrb 20s ease-in-out infinite;
}

.orb:nth-child(1) {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.6) 0%, transparent 70%);
  top: 10%;
  left: -5%;
  animation-delay: 0s;
}

.orb:nth-child(2) {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 119, 198, 0.5) 0%, transparent 70%);
  top: 60%;
  right: -3%;
  animation-delay: -7s;
  animation-duration: 25s;
}

.orb:nth-child(3) {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(100, 200, 255, 0.4) 0%, transparent 70%);
  bottom: 5%;
  left: 30%;
  animation-delay: -14s;
  animation-duration: 22s;
}

@keyframes floatOrb {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -20px) scale(1.1);
  }
  50% {
    transform: translate(-20px, 30px) scale(0.9);
  }
  75% {
    transform: translate(20px, 20px) scale(1.05);
  }
}

/* ============ 萤火虫效果 ============ */
.fireflies {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  background: radial-gradient(circle, rgba(253, 230, 138, 1) 0%, rgba(253, 230, 138, 0) 70%);
  border-radius: 50%;
  box-shadow: 
    0 0 10px rgba(253, 230, 138, 0.8),
    0 0 20px rgba(253, 230, 138, 0.6),
    0 0 30px rgba(253, 230, 138, 0.4);
  animation: fireflyFloat 8s ease-in-out infinite;
}

.firefly:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
  animation-duration: 10s;
}

.firefly:nth-child(2) {
  left: 25%;
  top: 60%;
  animation-delay: -2s;
  animation-duration: 12s;
}

.firefly:nth-child(3) {
  left: 70%;
  top: 30%;
  animation-delay: -4s;
  animation-duration: 9s;
}

.firefly:nth-child(4) {
  left: 85%;
  top: 70%;
  animation-delay: -6s;
  animation-duration: 11s;
}

.firefly:nth-child(5) {
  left: 50%;
  top: 85%;
  animation-delay: -3s;
  animation-duration: 8s;
}

.firefly:nth-child(6) {
  left: 15%;
  top: 80%;
  animation-delay: -5s;
  animation-duration: 13s;
}

@keyframes fireflyFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.3;
  }
  25% {
    transform: translate(30px, -40px) scale(1.2);
    opacity: 1;
  }
  50% {
    transform: translate(-20px, -20px) scale(0.8);
    opacity: 0.6;
  }
  75% {
    transform: translate(40px, 30px) scale(1.1);
    opacity: 0.9;
  }
}

/* 认证容器 */
.auth-container {
  position: relative;
  z-index: 1;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 认证盒子 */
.auth-box {
  background: linear-gradient(
    145deg,
    rgba(30, 27, 75, 0.85) 0%,
    rgba(49, 46, 129, 0.7) 50%,
    rgba(76, 29, 149, 0.6) 100%
  );
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  padding: 45px 40px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 0 100px rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: visible;
}

/* 登录框顶部高光 */
.auth-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 100%;
}

/* 登录框装饰光点 */
.auth-box::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  top: -75px;
  right: -75px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
  pointer-events: none;
}

/* 头部 */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

/* ============ 唯美 Logo ============ */
.auth-logo {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  font-size: 32px;
  color: #fff;
  z-index: 2;
  animation: logoFloat 3s ease-in-out infinite;
  text-shadow: 
    0 0 20px rgba(167, 139, 250, 0.8),
    0 0 40px rgba(167, 139, 250, 0.5),
    0 0 60px rgba(167, 139, 250, 0.3);
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.05);
  }
}

.logo-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid transparent;
}

.logo-ring:nth-child(1) {
  border-color: rgba(167, 139, 250, 0.5);
  animation: ringRotate 4s linear infinite, ringPulse 2s ease-in-out infinite;
}

.logo-ring:nth-child(2) {
  width: 90%;
  height: 90%;
  top: 5%;
  left: 5%;
  border-color: rgba(236, 72, 153, 0.4);
  animation: ringRotate 3s linear infinite reverse, ringPulse 2s ease-in-out infinite 0.5s;
}

@keyframes ringRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes ringPulse {
  0%, 100% {
    opacity: 0.5;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.3);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 25px rgba(167, 139, 250, 0.6);
  }
}

.auth-header h2 {
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 10px 0;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 30%, #f0abfc 60%, #fff 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerText 4s ease-in-out infinite;
}

@keyframes shimmerText {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.auth-header p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin: 0;
  letter-spacing: 1px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab 切换 */
.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 6px;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.85);
}

.auth-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 表单 */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group input {
  width: 100%;
  padding: 15px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(15, 15, 35, 0.6);
  color: #fff;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
  letter-spacing: 0.5px;
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.form-group input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  background: rgba(15, 15, 35, 0.8);
  box-shadow: 
    0 0 0 3px rgba(139, 92, 246, 0.15),
    0 0 30px rgba(139, 92, 246, 0.2),
    inset 0 0 20px rgba(139, 92, 246, 0.05);
}

.form-group label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  padding-left: 4px;
  letter-spacing: 0.5px;
}

/* 错误提示 */
.form-error {
  color: #ff6b6b;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 提交按钮 */
.auth-submit {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
  background-size: 200% 200%;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s ease;
  margin-top: 12px;
  box-shadow: 
    0 4px 20px rgba(139, 92, 246, 0.4),
    0 0 0 0 rgba(139, 92, 246, 0);
  position: relative;
  overflow: hidden;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 按钮闪光效果 */
.auth-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.auth-submit:hover::before {
  left: 100%;
}

.auth-submit:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 
    0 12px 35px rgba(139, 92, 246, 0.5),
    0 0 50px rgba(236, 72, 153, 0.3);
}

.auth-submit:active {
  transform: translateY(-2px) scale(1.01);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

.auth-submit:disabled::before {
  display: none;
}

/* 分割线 */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
}

.auth-divider span {
  padding: 0 20px;
}

/* 匿名访问按钮 */
.auth-anonymous {
  width: 100%;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-anonymous:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.auth-anonymous:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 页脚 */
.auth-footer {
  margin-top: 20px;
  text-align: center;
}

.auth-footer p {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  margin: 0;
  letter-spacing: 0.5px;
}

/* 用户状态栏（可选的退出按钮） */
.auth-user-bar {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-user-bar .user-email {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.auth-user-bar .logout-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 107, 107, 0.8);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-user-bar .logout-btn:hover {
  background: rgba(255, 107, 107, 1);
}

/* 响应式适配 */
@media (max-width: 480px) {
  .auth-container {
    padding: 16px;
    max-width: 100%;
  }
  
  .auth-box {
    padding: 32px 24px;
    border-radius: 20px;
  }
  
  .auth-header h2 {
    font-size: 24px;
  }
  
  .auth-tab {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .form-group input {
    padding: 12px 16px;
  }
  
  .auth-submit {
    padding: 14px;
  }
}

/* 深色主题适配（如果网站有主题切换） */
[data-theme="dark"] .auth-box {
  background: rgba(30, 30, 40, 0.9);
}

/* 加载动画 */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-submit.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

/* ============ 背景音乐控制 ============ */
.auth-music-control {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.2) 100%);
  backdrop-filter: blur(15px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
  position: relative;
  overflow: visible;
  box-shadow: 
    0 4px 20px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.music-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.15) rotate(10deg);
  box-shadow: 
    0 8px 30px rgba(139, 92, 246, 0.5),
    0 0 40px rgba(236, 72, 153, 0.3);
}

.music-btn.playing {
  border-color: rgba(253, 230, 138, 0.5);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5) 0%, rgba(236, 72, 153, 0.4) 100%);
  box-shadow: 
    0 0 25px rgba(253, 230, 138, 0.4),
    0 0 50px rgba(139, 92, 246, 0.3);
  animation: musicPulse 2s ease-in-out infinite;
}

.music-icon {
  font-size: 22px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.music-btn.playing .music-icon {
  animation: musicBounce 0.6s ease-in-out infinite alternate;
  text-shadow: 
    0 0 10px rgba(253, 230, 138, 0.8),
    0 0 20px rgba(253, 230, 138, 0.5);
}

@keyframes musicPulse {
  0%, 100% {
    box-shadow: 
      0 0 25px rgba(253, 230, 138, 0.3),
      0 0 50px rgba(139, 92, 246, 0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 
      0 0 35px rgba(253, 230, 138, 0.5),
      0 0 70px rgba(236, 72, 153, 0.3);
    transform: scale(1.05);
  }
}

@keyframes musicBounce {
  0% {
    transform: scale(1) rotate(-8deg);
  }
  100% {
    transform: scale(1.15) rotate(8deg);
  }
}

/* 音乐波纹效果 */
.music-btn.playing::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(253, 230, 138, 0.6);
  animation: musicRipple 2s ease-out infinite;
}

.music-btn.playing::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(236, 72, 153, 0.5);
  animation: musicRipple 2s ease-out infinite 0.7s;
}

@keyframes musicRipple {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}


