/* age动漫网站自定义样式 */

/* 平滑过渡效果 */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, 
              transform 0.3s ease, box-shadow 0.3s ease;
}

/* 页面加载状态 */
body {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

body.loaded {
  opacity: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* 导航栏增强 */
header {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 卡片悬停效果增强 */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 按钮动画效果 */
.btn-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(139, 92, 246, 0);
  }
}

/* 移动端优化 */
@media (max-width: 768px) {
  /* 移动端菜单动画 */
  #mobileMenu {
    transition: all 0.3s ease-in-out;
    transform-origin: top;
  }
  
  #mobileMenu.hidden {
    transform: scaleY(0);
    opacity: 0;
  }
  
  #mobileMenu:not(.hidden) {
    transform: scaleY(1);
    opacity: 1;
  }
  
  /* 移动端卡片间距优化 */
  .mobile-spacing {
    padding: 1rem;
  }
}

/* 背景色块样式 */
.color-block {
  background: linear-gradient(45deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 焦点可访问性 */
a:focus, button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* 文字选择样式 */
::selection {
  background-color: rgba(102, 126, 234, 0.3);
  color: inherit;
}

/* 加载动画 */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 响应式图片 */
img {
  max-width: 100%;
  height: auto;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 防止水平滚动 */
body {
  overflow-x: hidden;
}

/* 提高可读性 */
p, li {
  line-height: 1.6;
}

/* 链接下划线动画 */
.link-underline {
  position: relative;
  text-decoration: none;
}

.link-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #667eea;
  transition: width 0.3s ease;
}

.link-underline:hover::after {
  width: 100%;
}