/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 页面基础样式 */
body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  overflow: hidden;
}

/* 阿里字体 - 使用系统默认中文字体作为替代 */
@font-face {
  font-family: 'AliPuHui';
  src: local('PingFang SC'), local('Hiragino Sans GB'), local('Microsoft YaHei'), 
       local('WenQuanYi Micro Hei'), local('sans-serif');
  font-display: swap;
}

/* Libre Baskerville 字体 */
@font-face {
  font-family: 'Libre Baskerville';
  src: url('libre_baskerville.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap; /* 控制字体加载行为，swap 表示先显示后备字体，加载完成后替换 */
}

/* 背景动画 */
@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 容器样式 */
.container {
  text-align: center;
  max-width: 800px;
  padding: 20px;
  font-family: 'AliPuHui', sans-serif;
  /* 确保容器居中 */
  margin: 0 auto;
}

/* 动画标题样式 */
.animated-title {
  /* 默认字体，等待 JavaScript 动态设置为 'Libre Baskerville' */
  font-family: 'Courier New', monospace; 
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  perspective: 1000px;
  letter-spacing: -1px;
  /* 优化字体渲染 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 科技感文本效果 */
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 150, 255, 0.7), 
               0 0 20px rgba(0, 100, 255, 0.5),
               0 0 30px rgba(0, 50, 255, 0.3);
  /* 防止文字换行 */
  white-space: nowrap;
  /* 保持inline-block以确保正确显示 */
  display: inline-block;
  /* 添加相对定位以便光斑定位 */
  position: relative;
  /* 确保z-index正确 */
  z-index: 1;
  /* 确保不会超出容器 */
  max-width: 100%;
  overflow: visible;
  /* 添加内边距确保字母不被截断 */
  padding: 0 10px;
}

/* 呼吸灯效果的白色光斑 */
.animated-title::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 46%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  opacity: 0.7;
  z-index: -1;
  animation: lightPulse 2s ease-in-out infinite;
  pointer-events: none;
  filter: blur(10px);
}

/* 呼吸灯动画 */
@keyframes lightPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.4;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.8;
  }
}

/* 字母样式 */
.letter {
  display: inline-block;
  animation: flipIn 1s ease forwards;
  opacity: 0;
  transform: rotateY(-90deg);
  animation-delay: var(--delay);
  /* 改善字体清晰度 */
  text-shadow: none;
  will-change: transform, opacity;
}

/* 空格样式 */
.space {
  display: inline-block;
  width: 0.5em;
  animation: expandSpace 1s ease forwards;
  opacity: 0;
  animation-delay: 0.55s;
}

/* 空格展开动画 */
@keyframes expandSpace {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: 0.5em;
    opacity: 1;
  }
}

/* 翻转进入动画 */
@keyframes flipIn {
  0% {
    transform: rotateY(-90deg);
    opacity: 0;
  }
  50% {
    transform: rotateY(20deg);
  }
  100% {
    transform: rotateY(0deg);
    opacity: 1;
  }
}

/* 内容区域样式 */
.content {
  animation: fadeIn 1s ease 1.5s forwards;
  opacity: 0;
}

/* 淡入动画 */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .animated-title {
    font-size: 2.5rem;
    letter-spacing: -1px;
    padding: 0 5px;
  }
  
  .content h2 {
    font-size: 1.5rem;
  }
  
  .content p {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .animated-title {
    font-size: 1.8rem;
    letter-spacing: -1px;
    padding: 0 3px;
  }
  
  .content h2 {
    font-size: 1.2rem;
  }
  
  .content p {
    font-size: 0.9rem;
  }
}