/* --- 核心 CSS 动画系统 --- */

/* 全局滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #fdf2f8;
}

::-webkit-scrollbar-thumb {
  background: #f472b6;
  border-radius: 10px;
}

/* 3D 倾斜卡片容器 */
.tilt-card {
  transition: transform 0.1s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}

.tilt-content {
  transform: translateZ(20px);
  /* 让内容浮起来 */
}

/* 动态光泽效果 */
.card-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.3),
    transparent 40%
  );
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s;
}

.tilt-card:hover .card-shine {
  opacity: 1;
}

/* 彩色流光文字特效 */
.colorful-text {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    90deg,
    #ff0000,
    #ff7f00,
    #ffff00,
    #00ff00,
    #0000ff,
    #8b00ff,
    #ff0000
  );
  background-size: 400%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-move 8s linear infinite;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes rainbow-move {
  0% {
    background-position: 0%;
  }

  100% {
    background-position: 400%;
  }
}

/* 滚动显现动画 */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-on-scroll.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* 樱花飘落 */
@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg) translateX(0px);
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  100% {
    transform: translateY(110vh) rotate(360deg) translateX(50px);
    opacity: 0;
  }
}

.petal {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* 旋转动画 (用于音乐胶片) */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.animate-spin-slow {
  animation: spin-slow 8s linear infinite;
}

/* 暂停旋转 */
.paused-spin {
  animation-play-state: paused;
}

/* 移动端菜单动画 */
#mobile-menu {
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.3s ease;
}

#mobile-menu.hidden-menu {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
}

#mobile-menu.visible-menu {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* 自定义进度条样式 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background: #ec4899;
  /* pink-500 */
  cursor: pointer;
  margin-top: -3px;
  /* 居中对齐 */
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.1s;
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: #e5e7eb;
  /* gray-200 */
  border-radius: 2px;
}

input[type="range"]:focus {
  outline: none;
}

/* 字体 */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700;900&family=ZCOOL+XiaoWei&display=swap");

body {
  font-family: "Noto Sans SC", sans-serif;
}

/* 特殊字体 */
.font-xiaowei {
  font-family: "ZCOOL XiaoWei", serif;
}

/* 交互变色逻辑 (使用 :has 选择器) */
/* 默认过渡 */
.story-title-interactive {
  transition: color 0.3s ease;
}

/* 当 Kirito 图片悬停时 */
.story-group:has(.img-kirito:hover) .story-title-interactive {
  color: #3b82f6;
}

/* 当 Eugeo 图片悬停时 */
.story-group:has(.img-eugeo:hover) .story-title-interactive {
  color: #eab308; /* Yellow-500 */
}
