
/* 基础样式 */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  font-family: 'Montserrat', sans-serif;
  background: linear-gradient(135deg, #1E1E2D, #2C2C3F);
  color: #FFFFFF;
  line-height: 1.6;
  scroll-behavior: smooth;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  padding: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

header, footer {
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

header h1 {
  font-size: 2.5rem;
  color: #7C3AED;
  margin: 0;
}

section {
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

/* 星河背景动画 */
.starry-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.3), transparent 70%);
  animation: galaxyFlow 60s linear infinite;
}

@keyframes galaxyFlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-50%, -50%); }
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  animation: starShimmer 3s infinite ease-in-out;
}

@keyframes starShimmer {
  0% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.5; transform: scale(1); }
}

/* 响应式布局 */
@media (max-width: 768px) {
  header h1 { font-size: 2rem; }
  .container { grid-template-columns: 1fr; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
  .container { grid-template-columns: repeat(3, 1fr); }
}

/* 模块化设计 */
.module {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.module:hover {
  transform: scale(1.02);
}

.module img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* 文章样式 */
article {
  background: rgba(0, 0, 0, 0.5);
  padding: 30px;
  border-radius: 10px;
  margin: 20px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

article h2, article h3 {
  color: #F59E0B;
  margin-top: 20px;
}

article pre {
  background: #1E1E2D;
  color: #7C3AED;
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
}

/* 微交互 */
button, a.button {
  background: #7C3AED;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover, a.button:hover {
  background: #F59E0B;
  transform: scale(1.1);
}

/* 动画效果 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

