/* ==================== 基础样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  line-height: 1.6;
}

/* ==================== 模糊球背景 ==================== */
.blur-ball {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  animation: float 8s ease-in-out infinite;
}

.blur-ball-indigo {
  background: #6366f1;
  top: 40px;
  left: 10%;
  opacity: 0.25;
  animation-delay: 0s;
}

.blur-ball-teal {
  background: #14b8a6;
  top: 200px;
  right: 10%;
  opacity: 0.2;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

/* 深色模式下模糊球更亮 */
.dark .blur-ball-indigo {
  opacity: 0.4;
}

.dark .blur-ball-teal {
  opacity: 0.35;
}

/* ==================== 闪光文字效果 ==================== */
.shine-text {
  background: linear-gradient(
    135deg,
    #6366f1 0%,
    #8b5cf6 25%,
    #6366f1 50%,
    #8b5cf6 75%,
    #6366f1 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ==================== Prose 样式 (Markdown渲染) ==================== */
.prose {
  color: inherit;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: inherit;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.prose p {
  margin-bottom: 0.75em;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}

.prose li {
  margin-bottom: 0.25em;
}

.prose a {
  color: #6366f1;
  text-decoration: none;
}

.prose a:hover {
  text-decoration: underline;
}

.prose code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.dark .prose code {
  background: rgba(255, 255, 255, 0.1);
}

.prose pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1em;
}

.dark .prose pre {
  background: rgba(255, 255, 255, 0.05);
}

.prose blockquote {
  border-left: 4px solid #6366f1;
  padding-left: 1em;
  margin-left: 0;
  color: rgba(0, 0, 0, 0.6);
}

.dark .prose blockquote {
  color: rgba(255, 255, 255, 0.6);
}

/* ==================== 卡片悬停效果 ==================== */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* ==================== 按钮样式增强 ==================== */
button, a {
  transition: all 0.2s ease;
}

/* ==================== 动画效果 ==================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slideUp {
  animation: slideUp 0.4s ease-out;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ==================== 弹窗动画 ==================== */
#tutorialModal > div,
#contactModal > div {
  animation: slideUp 0.3s ease-out;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 640px) {
  .blur-ball {
    width: 240px;
    height: 240px;
  }
  
  .blur-ball-indigo {
    left: -10%;
  }
  
  .blur-ball-teal {
    right: -10%;
  }
}

/* ==================== 打印样式 ==================== */
@media print {
  .blur-ball {
    display: none;
  }
  
  nav, footer {
    position: static;
  }
  
  body {
    background: white;
    color: black;
  }
}
