/* ============================================================
   全局样式变量
   ============================================================ */
:root {
  --hero-height: 100vh;                    /* 首页 hero 区域占满全屏 */
  --card-radius: 16px;                     /* 卡片圆角 */
  --card-shadow: 0 4px 24px rgba(0,0,0,0.08);  /* 卡片阴影 */
  --card-hover-shadow: 0 8px 40px rgba(0,0,0,0.15);  /* 悬停阴影 */
  --transition-speed: 0.3s;               /* 过渡动画速度 */
}

/* ============================================================
   首页 Hero 区域（全屏背景 + 标题）
   ============================================================ */
.hero-section {
  position: relative;
  width: 100%;
  height: var(--hero-height);
  /* 背景图：图片放在 docs/images/ 下，想换图就替换文件或修改下面的路径 */
  background: url('../images/background.jpg') center/cover no-repeat;
  /* 如果想改用渐变背景，注释掉上面那行，取消下面这行的注释： */
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 半透明遮罩层，让背景图上的文字更清晰 */
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  padding: 0 2rem;
}

.hero-title {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.9;
  text-shadow: 0 1px 5px rgba(0,0,0,0.3);
  animation: fadeInUp 1s ease-out 0.3s both;
}

/* 向下滚动提示 */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  z-index: 2;
  color: white;
  text-align: center;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-indicator span {
  font-size: 0.85rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 0.5rem;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  margin: 0 auto;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  opacity: 0.7;
}

/* ============================================================
   卡片区域
   ============================================================ */
.cards-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: var(--card-radius);
  background: var(--md-default-bg-color, #ffffff);
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--md-default-fg-color, #333333);
  transition: 
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  transition: height var(--transition-speed) ease;
}

/* 每种卡片的顶部色条（类名对应 overrides/main.html 里的卡片 class） */
.card-blog::before    { background: #ff6b6b; }
.card-class::before   { background: #feca57; }
.card-tech::before    { background: #48dbfb; }
.card-friends::before { background: #54a0ff; }
.card-about::before   { background: #5f27cd; }

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-hover-shadow);
}

.card:hover::before {
  height: 6px;
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-desc {
  font-size: 0.95rem;
  opacity: 0.7;
  line-height: 1.6;
}

/* ============================================================
   动画
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ============================================================
   让卡片在进入视口时产生动画（配合 extra.js）
   ============================================================ */
.card {
  opacity: 0;
  transform: translateY(20px);
  transition: 
    opacity 0.6s ease,
    transform 0.6s ease,
    box-shadow var(--transition-speed) ease;
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 每张卡片依次出现的延迟 */
.card:nth-child(1) { transition-delay: 0.1s; }
.card:nth-child(2) { transition-delay: 0.2s; }
.card:nth-child(3) { transition-delay: 0.3s; }
.card:nth-child(4) { transition-delay: 0.4s; }
.card:nth-child(5) { transition-delay: 0.5s; }
.card:nth-child(6) { transition-delay: 0.6s; }

/* ============================================================
   首页隐藏默认的文章内容区（因为首页用自定义模板）
   ============================================================ */
.md-content__inner > h1:first-child,
.md-content__inner > p {
  /* 首页的 markdown 内容被 main.html 覆盖了，
     但如果有残留文字，这里隐藏它们 */
}

/* ============================================================
   响应式适配（手机/平板）
   ============================================================ */
@media screen and (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .cards-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .cards-section {
    padding: 2rem 1rem;
  }
}

@media screen and (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
}

/* ============================================================
   暗色模式适配
   ============================================================ */
[data-md-color-scheme="slate"] .card {
  background: var(--md-default-bg-color);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

[data-md-color-scheme="slate"] .card:hover {
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

[data-md-color-scheme="slate"] .hero-section {
  /* 暗色模式下可以调整 hero 的渐变颜色 */
  background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
}