/* ===== 刘昀的可爱小天地 - 全局样式 ===== */

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #fce4ec;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #FF9EC6, #C9A0DC, #87CEEB);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff6fa8, #b07fd0, #5db8de);
}

/* 选中文字颜色 */
::selection {
  background: #FF9EC6;
  color: white;
}

/* ===== 自定义动画 ===== */

/* 浮动动画 */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}
.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* 慢速旋转 */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin-slow 4s linear infinite;
}

/* 摇摆动画 */
@keyframes wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
.animate-wiggle {
  animation: wiggle 1s ease-in-out infinite;
}

/* 挥手动画 */
@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(20deg); }
  75% { transform: rotate(-15deg); }
}
.animate-wave {
  animation: wave 1.5s ease-in-out infinite;
  display: inline-block;
  transform-origin: 70% 70%;
}

/* 飘落动画 */
@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

/* 弹跳进入 */
@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* 从左滑入 */
@keyframes slideInLeft {
  from { transform: translateX(-100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 从右滑入 */
@keyframes slideInRight {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 从下滑入 */
@keyframes slideInUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* 脉冲发光 */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 158, 198, 0.5); }
  50% { box-shadow: 0 0 25px rgba(255, 158, 198, 0.8), 0 0 50px rgba(201, 160, 220, 0.4); }
}

/* 彩虹文字动画 */
@keyframes rainbow {
  0% { color: #FF6B6B; }
  14% { color: #FFB347; }
  28% { color: #FFE66D; }
  42% { color: #98FB98; }
  57% { color: #87CEEB; }
  71% { color: #C9A0DC; }
  85% { color: #FF9EC6; }
  100% { color: #FF6B6B; }
}

/* 点赞爆炸粒子 */
@keyframes likeParticle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ===== 滚动显示动画类 ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 技能条动画 ===== */
.skill-bar {
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-bar.animated {
  width: var(--target-width);
}

/* ===== 卡片悬停效果 ===== */
.skill-card:hover {
  border-style: solid;
}
.habit-card:hover {
  border-style: solid;
}
.wish-card:hover {
  border-style: solid;
}
.photo-card:hover {
  border-style: solid;
}

/* ===== 导航链接下划线效果 ===== */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #FF9EC6, #C9A0DC, #87CEEB);
  transition: width 0.3s ease;
}
.nav-link:hover::after {
  width: 100%;
}

/* ===== 飘落装饰元素 ===== */
.floating-item {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  animation: fall linear forwards;
  font-size: 24px;
}

/* ===== 留言卡片 ===== */
.message-card {
  animation: slideInUp 0.5s ease-out;
}

/* ===== 点赞粒子 ===== */
.like-particle {
  position: absolute;
  pointer-events: none;
  animation: likeParticle 0.8s ease-out forwards;
}

/* ===== Section标题装饰 ===== */
.section-title {
  position: relative;
  display: inline-block;
  width: 100%;
}
.section-title::before,
.section-title::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #FF9EC6, #C9A0DC);
}
.section-title::before {
  left: calc(50% - 200px);
}
.section-title::after {
  right: calc(50% - 200px);
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
  .section-title::before,
  .section-title::after {
    display: none;
  }
}

/* ===== 吹牛按钮特效 ===== */
#brag-btn {
  position: relative;
  overflow: hidden;
}
#brag-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: shine 3s infinite;
}
@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

/* ===== 背景装饰圆点 ===== */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 198, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(135, 206, 235, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 打字机效果 ===== */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.typing-cursor::after {
  content: '|';
  animation: blink 0.8s infinite;
  color: #FF9EC6;
  font-weight: bold;
}

/* ===== 心情按钮选中状态 ===== */
.mood-btn.active {
  transform: scale(1.3);
  filter: drop-shadow(0 0 8px rgba(255, 158, 198, 0.6));
}

/* ===== 页面加载动画 ===== */
@keyframes pageLoad {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
main > section {
  animation: pageLoad 0.8s ease-out both;
}
main > section:nth-child(2) { animation-delay: 0.1s; }
main > section:nth-child(3) { animation-delay: 0.2s; }
main > section:nth-child(4) { animation-delay: 0.3s; }
main > section:nth-child(5) { animation-delay: 0.4s; }
main > section:nth-child(6) { animation-delay: 0.5s; }
main > section:nth-child(7) { animation-delay: 0.6s; }