/* 自定义样式 - 阿野的野径 */

/* 全局变量 */
:root {
  --vp-c-brand: #4a9eff;
  --vp-c-brand-light: #6eb4ff;
  --vp-c-brand-dark: #2d7dd2;
  --vp-c-text: #2c3e50;
  --vp-c-bg: #ffffff;
  --vp-c-bg-soft: #f6f8fa;
}

/* 暗色主题 */
.dark {
  --vp-c-brand: #58a6ff;
  --vp-c-brand-light: #79c0ff;
  --vp-c-brand-dark: #388bfd;
  --vp-c-text: #e6edf3;
  --vp-c-bg: #0d1117;
  --vp-c-bg-soft: #161b22;
}

/* 首页标题动效 */
.VPHero .name {
  background: linear-gradient(90deg, var(--vp-c-brand), #9b5cff, #ff6b9d);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite;
}

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

/* 导航栏悬停动效 */
.VPNavBarMenuLink {
  position: relative;
  transition: color 0.3s ease;
}

.VPNavBarMenuLink::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--vp-c-brand);
  transition: width 0.3s ease;
}

.VPNavBarMenuLink:hover::after {
  width: 100%;
}

.VPNavBarMenuLink:hover {
  color: var(--vp-c-brand);
}

/* 按钮悬停动效 */
.VPButton {
  transition: all 0.3s ease !important;
  transform: translateY(0);
}

.VPButton:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

/* 卡片悬停动效 */
.VPFeature {
  transition: all 0.3s ease;
  border: 1px solid var(--vp-c-divider);
}

.VPFeature:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.2);
  border-color: var(--vp-c-brand);
}

/* 文章卡片 */
.vp-doc a {
  color: var(--vp-c-brand);
  transition: color 0.3s ease;
}

.vp-doc a:hover {
  color: var(--vp-c-brand-light);
  text-decoration: underline;
}

/* 代码块优化 */
.vp-doc div[class*='language-'] {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 表格优化 */
.vp-doc table {
  border-radius: 8px;
  overflow: hidden;
}

/* 引用块优化 */
.vp-doc blockquote {
  border-left: 4px solid var(--vp-c-brand);
  background: var(--vp-c-bg-soft);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

/* 图片圆角 */
.vp-doc img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--vp-c-bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--vp-c-brand);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--vp-c-brand-dark);
}

/* 加载动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.VPHero, .VPFeature, .VPNavBar {
  animation: fadeIn 0.6s ease-out;
}

/* 🎵 音乐播放器 - 水波纹律动版 */

.music-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: var(--vp-font-family-base);
  --audio-intensity: 0;
}

/* 歌曲信息 - 悬停显示 */
.music-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--vp-c-bg);
  border: 1px solid var(--vp-c-divider);
  border-radius: 16px;
  padding: 10px 16px 10px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  position: relative;
  overflow: visible;
}

/* 鼠标悬停时显示 */
.music-info.hover {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* 唱片包装器 */
.music-disc-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 黑胶唱片 */
.music-disc {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.disc-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    from 0deg,
    hsl(var(--disc-hue, 220) var(--disc-lightness, 50%) 0%),
    hsl(calc(var(--disc-hue, 220) + 60) calc(var(--disc-lightness, 50%) + 10%) 50%),
    hsl(var(--disc-hue, 220) var(--disc-lightness, 50%) 100%)
  );
  transition: all 0.1s ease;
}

/* 同心圆纹理 */
.disc-inner::before {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    hsl(calc(var(--disc-hue, 220) + 30) calc(var(--disc-lightness, 50%) - 10%) 0%),
    hsl(var(--disc-hue, 220) calc(var(--disc-lightness, 50%) + 5%) 100%)
  );
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.disc-inner::after {
  content: '';
  position: absolute;
  width: 40%;
  height: 40%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vp-c-brand), var(--vp-c-brand-dark));
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.5);
}

/* 唱片文字 */
.disc-text {
  position: absolute;
  font-size: 16px;
  font-weight: 700;
  color: white;
  z-index: 10;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

/* 旋转动画 */
.music-disc.rotating {
  animation: rotateDisc 3s linear infinite;
}

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

/* 水波纹容器 */
.ripple-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* 单个水波纹 */
.ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    hsla(var(--ripple-hue, 220), 80%, 60%, var(--ripple-opacity, 0.5)) 0%,
    hsla(var(--ripple-hue, 220), 80%, 60%, 0.3) 40%,
    hsla(var(--ripple-hue, 220), 80%, 60%, 0.1) 70%,
    transparent 100%
  );
  animation: rippleExpand 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes rippleExpand {
  0% {
    width: 52px;
    height: 52px;
    opacity: var(--ripple-opacity, 0.5);
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    width: calc(52px * var(--ripple-scale, 3));
    height: calc(52px * var(--ripple-scale, 3));
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--ripple-scale, 3));
  }
}

/* 多层波纹效果 */
.ripple::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  border: 2px solid hsla(var(--ripple-hue, 220), 80%, 60%, 0.4);
  animation: rippleBorder 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

/* 歌曲文字 */
.music-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.music-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--vp-c-text);
  line-height: 1.4;
}

.music-desc {
  font-size: 12px;
  color: var(--vp-c-text-2);
  opacity: 0.8;
  line-height: 1.3;
}

/* 控制按钮区域 */
.music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 播放按钮包装器 */
.play-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* 播放按钮 */
.music-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--vp-c-brand) 0%, var(--vp-c-brand-dark) 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(74, 158, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  flex-shrink: 0;
}

.music-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(74, 158, 255, 0.6);
}

.music-btn:active {
  transform: scale(0.95);
}

.music-btn svg {
  width: 24px;
  height: 24px;
}

/* 音量菜单（集成到播放按钮） */
.volume-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: var(--vp-c-bg);
  border: 1px solid var(--vp-c-divider);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  z-index: 10;
}

.play-wrapper:hover .volume-menu {
  opacity: 1;
  transform: translate(-50%, -60px) scale(1);
  pointer-events: auto;
}

.volume-menu.show {
  opacity: 1;
  transform: translate(-50%, -60px) scale(1);
  pointer-events: auto;
}

.volume-label {
  font-size: 12px;
  color: var(--vp-c-text-2);
  font-weight: 500;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--vp-c-bg-soft);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vp-c-brand), var(--vp-c-brand-dark));
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
  transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(74, 158, 255, 0.6);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vp-c-brand), var(--vp-c-brand-dark));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
  transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(74, 158, 255, 0.6);
}

.volume-value {
  font-size: 11px;
  color: var(--vp-c-text-2);
  font-family: monospace;
  background: var(--vp-c-bg-soft);
  padding: 2px 8px;
  border-radius: 4px;
}

/* 暗色主题适配 */
.dark .music-disc {
  background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
}

.dark .music-info {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .music-player {
    bottom: 16px;
    right: 16px;
  }
  
  .music-info {
    padding: 8px 12px 8px 8px;
    border-radius: 12px;
  }
  
  .music-disc-wrapper {
    width: 48px;
    height: 48px;
  }
  
  .music-disc {
    width: 44px;
    height: 44px;
  }
  
  .ripple {
    width: 44px;
    height: 44px;
  }
  
  .disc-text {
    font-size: 14px;
  }
  
  .music-title {
    font-size: 13px;
  }
  
  .music-desc {
    font-size: 11px;
  }
  
  .music-btn {
    width: 48px;
    height: 48px;
  }
  
  .music-btn svg {
    width: 22px;
    height: 22px;
  }
  
  .volume-menu {
    min-width: 120px;
    padding: 10px 12px;
  }
  
  .volume-slider {
    width: 100%;
  }
}

/* 回到顶部按钮 */
.VPSwitch {
  transition: all 0.3s ease;
}

.VPSwitch:hover {
  transform: scale(1.1);
}
