/**
 * UI++ 优化样式库 - 精简版
 * 为林辰云个人引导页添加现代化UI效果
 * 保持原有功能不变，只添加视觉和交互增强
 */

/* ==================== CSS变量定义 ==================== */
:root {
  --primary-glow: rgba(120, 119, 198, 0.3);
  --secondary-glow: rgba(255, 107, 107, 0.2);
  --success-glow: rgba(76, 175, 80, 0.2);
  --ripple-color: rgba(255, 255, 255, 0.25);
  --shadow-elevation-1: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-elevation-2: 0 4px 20px rgba(0, 0, 0, 0.12);
  --shadow-elevation-3: 0 8px 40px rgba(0, 0, 0, 0.16);
  --shadow-elevation-4: 0 16px 60px rgba(0, 0, 0, 0.2);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ==================== 按钮增强 ==================== */
.glass-button {
  position: relative !important;
  overflow: hidden !important;
  transition: all var(--transition-normal) !important;
  will-change: transform, box-shadow;
  transform: translateZ(0);
}

.glass-button:hover {
  transform: translateY(-2px) scale(1.02) !important;
  box-shadow: var(--shadow-elevation-2), 0 0 20px var(--primary-glow) !important;
}

.glass-button:active {
  transform: translateY(0) scale(0.98) !important;
  transition-duration: 0.1s !important;
}

.glass-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: var(--ripple-color);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.glass-button:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0) translate(-50%, -50%);
    opacity: 0.5;
  }
  20% {
    transform: scale(20, 20) translate(-50%, -50%);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40) translate(-50%, -50%);
  }
}

#sponsorBtn {
  background: linear-gradient(45deg, rgba(255, 107, 107, 0.9), rgba(120, 119, 198, 0.9)) !important;
  animation: gentlePulse 3s ease-in-out infinite !important;
}

@keyframes gentlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.9; }
}

/* ==================== 玻璃容器增强 ==================== */
.glass-container {
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    var(--shadow-elevation-2) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
  transition: all var(--transition-normal) !important;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.glass-container:hover {
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(255, 255, 255, 0.15),
    var(--shadow-elevation-3) !important;
  transform: translateY(-1px) !important;
}

.user-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.05) 100%) !important;
  position: relative;
  isolation: isolate;
}

.user-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

/* ==================== 头像和徽章优化 ==================== */
.avatar-section {
  position: relative !important;
  display: inline-block !important;
}

.avatar-section:hover .avatar {
  transform: scale(1.03) !important;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.25)) brightness(1.03) !important;
}

.avatar-section:hover .avatar-frame {
  transform: scale(1.03) rotate(3deg) !important;
  filter: brightness(1.1) saturate(1.1) !important;
}

.avatar {
  transition: all var(--transition-normal) !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2)) !important;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.avatar-frame {
  position: absolute !important;
  z-index: 2 !important;
  pointer-events: none !important;
  animation: gentleFrameFloat 3s ease-in-out infinite !important;
  transform: translateZ(0);
}

@keyframes gentleFrameFloat {
  0%, 100% { 
    transform: translateY(0) rotate(0deg);
    filter: brightness(1) saturate(1);
  }
  50% { 
    transform: translateY(-1px) rotate(0.5deg);
    filter: brightness(1.05) saturate(1.05);
  }
}

.badge {
  transition: all var(--transition-normal) !important;
  filter: saturate(0.8) !important;
}

.badge:hover {
  transform: scale(1.2) rotate(10deg) !important;
  filter: saturate(1.2) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2)) !important;
  z-index: 10 !important;
}

.badge:nth-child(1) { animation-delay: 0.1s !important; }
.badge:nth-child(2) { animation-delay: 0.2s !important; }
.badge:nth-child(3) { animation-delay: 0.3s !important; }
.badge:nth-child(4) { animation-delay: 0.4s !important; }
.badge:nth-child(5) { animation-delay: 0.5s !important; }

/* ==================== 音乐播放器增强 ==================== */
.vinyl.playing {
  animation: spin 20s linear infinite !important;
}

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

.control-btn {
  position: relative !important;
  transition: all var(--transition-fast) !important;
  transform: translateZ(0);
}

.control-btn:hover {
  transform: scale(1.1) !important;
  background: rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.control-btn:active {
  transform: scale(0.95) !important;
}

#playBtn {
  position: relative !important;
  overflow: hidden !important;
}

#playBtn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

#playBtn:hover::before {
  opacity: 1;
}

.volume-slider {
  -webkit-appearance: none !important;
  appearance: none !important;
  height: 4px !important;
  background: rgba(255, 255, 255, 0.2) !important;
  border-radius: 2px !important;
  outline: none !important;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  background: white !important;
  cursor: pointer !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
  transition: all var(--transition-fast) !important;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
}

/* ==================== 文字和内容增强 ==================== */
.username {
  position: relative !important;
  display: inline-block !important;
  background: linear-gradient(45deg, #ff8a8a, #a5a4ff, #5de8e0) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  background-size: 200% 200% !important;
  animation: gradientShift 6s ease infinite !important;
  text-shadow: 
    0 1px 1px rgba(0, 0, 0, 0.1),
    0 0 20px rgba(255, 255, 255, 0.05) !important;
}

@keyframes gradientShift {
  0% { 
    background-position: 0% 50%;
    filter: brightness(1) saturate(1);
  }
  25% { 
    background-position: 50% 100%;
    filter: brightness(1.1) saturate(1.1);
  }
  50% { 
    background-position: 100% 50%;
    filter: brightness(1.05) saturate(1.05);
  }
  75% { 
    background-position: 50% 0%;
    filter: brightness(1.1) saturate(1.1);
  }
  100% { 
    background-position: 0% 50%;
    filter: brightness(1) saturate(1);
  }
}

.username::before {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  background: linear-gradient(45deg, rgba(255, 138, 138, 0.1), rgba(165, 164, 255, 0.1), rgba(109, 232, 224, 0.1)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  filter: blur(4px);
  opacity: 0.6;
  animation: glowShift 6s ease infinite !important;
}

@keyframes glowShift {
  0% { transform: translateX(-1px) translateY(-1px); }
  25% { transform: translateX(1px) translateY(-1px); }
  50% { transform: translateX(1px) translateY(1px); }
  75% { transform: translateX(-1px) translateY(1px); }
  100% { transform: translateX(-1px) translateY(-1px); }
}

.username:hover {
  animation: gradientShift 3s ease infinite !important;
}

.username:hover::before {
  opacity: 0.8;
  filter: blur(6px);
  transition: all 0.3s ease;
}

.random-quote {
  position: relative !important;
  padding: 10px 0 !important;
}

.random-quote::before,
.random-quote::after {
  content: '"' !important;
  position: absolute !important;
  font-size: 24px !important;
  color: rgba(255, 255, 255, 0.3) !important;
  font-family: serif !important;
}

.random-quote::before {
  top: 0 !important;
  left: -15px !important;
}

.random-quote::after {
  bottom: 0 !important;
  right: -15px !important;
}

/* ==================== 弹窗和模态框优化 ==================== */
.modal-content {
  animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  transform-origin: center center !important;
}

@keyframes modalAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tab-btn {
  position: relative !important;
  overflow: hidden !important;
  transition: all var(--transition-normal) !important;
}

.tab-btn::after {
  content: '';
  position: absolute !important;
  bottom: 0 !important;
  left: 50% !important;
  width: 0 !important;
  height: 2px !important;
  background: linear-gradient(45deg, #ff6b6b, #7877c6) !important;
  transition: all var(--transition-normal) !important;
  transform: translateX(-50%) !important;
}

.tab-btn.active::after {
  width: 80% !important;
}

.tab-btn:hover::after {
  width: 60% !important;
}

.qr-code img {
  transition: all var(--transition-normal) !important;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15)) !important;
}

.qr-code img:hover {
  transform: scale(1.02) !important;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25)) !important;
}

/* ==================== 状态指示器 ==================== */
.network-status {
  position: relative !important;
  padding-left: 24px !important;
}

.network-status::before {
  content: '';
  position: absolute !important;
  left: 0 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  background: currentColor !important;
  box-shadow: 0 0 10px currentColor !important;
  animation: statusPulse 2s ease-in-out infinite !important;
}

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

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
  .glass-button {
    min-height: 48px !important;
    min-width: 48px !important;
  }
  
  @media (hover: none) {
    .glass-button:hover,
    .glass-container:hover,
    .badge:hover,
    .control-btn:hover {
      transform: none !important;
    }
  }
  
  .glass-button:active {
    transform: scale(0.96) !important;
    opacity: 0.8 !important;
  }
}

/* 高性能动画设置 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== 细节优化 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  transition: background var(--transition-normal);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

::selection {
  background: rgba(120, 119, 198, 0.3);
  color: white;
}

::-moz-selection {
  background: rgba(120, 119, 198, 0.3);
  color: white;
}

:focus {
  outline: 2px solid rgba(120, 119, 198, 0.5);
  outline-offset: 2px;
}

/* 图层提升 */
.music-container,
.buttons-container {
  isolation: isolate;
}

/* 打印样式优化 */
@media print {
  .glass-container {
    box-shadow: none !important;
    background: white !important;
    border: 1px solid #ddd !important;
  }
  
  .glass-button,
  .control-btn,
  .tab-btn {
    border: 1px solid #333 !important;
    background: #f5f5f5 !important;
    color: #333 !important;
  }
}