/* ================= 全局基础样式 ================= */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

/* ================= 背景容器样式 ================= */
#web_bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -9999;
  background-color: transparent !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
  pointer-events: none;
  transition: background-image 1s ease-in-out;
  transform: translateZ(0);
}

/* ================= 封面区块样式 ================= */
#cover-block {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  position: relative;
  z-index: 1;
  font-family: 
    'PingFang SC', 
    'HarmonyOS Sans SC',
    'Microsoft YaHei',
    sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.cover-content {
  max-width: 800px;
  padding: 2rem;
  border-radius: 15px;
  animation: fadeIn 1.5s ease;
  /* background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px); */
}

.cover-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
  text-shadow: 
    0 2px 4px rgba(0,0,0,0.3),
    0 4px 12px rgba(0,0,0,0.2);
}

.cover-subtitle {
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  line-height: 1.6;
  color: rgba(0,0,0,0.9);
  max-width: 80%;
  margin: 0 auto;
  font-style: italic;
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  font-size: 1.5rem;
  color: rgba(255,255,255,0.8);
}

/* ================= 文章卡片样式 ================= */
.recent-post-item {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  box-shadow: var(--anzhiyu-shadow-border);
  margin-bottom: 2rem;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  overflow: hidden;
  color: var(--anzhiyu-meta-theme-post-color);
  border: var(--style-border);
}

.recent-post-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--anzhiyu-shadow-theme);
}

.post_cover, 
.recent-post-info {
  background: transparent !important;
}

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

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

/* ================= 暗黑模式适配 ================= */
[data-theme="dark"] {
  /* 封面文字颜色修正 */
  .cover-subtitle {
    color: rgba(255,255,255,0.9) !important;
  }
  
  .scroll-indicator {
    color: rgba(255,255,255,0.8) !important;
  }

  /* 文章卡片适配 */
  .recent-post-item {
    background: var(--anzhiyu-card-bg) !important;
    color: var(--anzhiyu-fontcolor) !important;
    border: var(--style-border-always) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
  }

  .recent-post-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.4) !important;
  }

  /* 确保内部元素颜色 */
  .recent-post-item * {
    color: var(--anzhiyu-fontcolor) !important;
  }
  
  /* 新增：悬停时标题变黄效果 */
  .recent-post-item:hover .recent-post-info .article-title,
  .recent-post-item:hover .recent-post-info h2 {
    color: var(--anzhiyu-lighttext) !important; /* 使用主题的黄色变量 */
    transition: color 0.3s ease;
    text-shadow: 0 0 5px rgba(242, 185, 75, 0.3); /* 可选：添加发光效果 */
  }
}

/* 系统级暗黑模式适配 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* 与上方[data-theme="dark"]相同的样式 */
    .cover-subtitle {
      color: rgba(255,255,255,0.9) !important;
    }
    
    .scroll-indicator {
      color: rgba(255,255,255,0.8) !important;
    }

    .recent-post-item {
      background: var(--anzhiyu-card-bg) !important;
      color: var(--anzhiyu-fontcolor) !important;
      border: var(--style-border-always) !important;
    }

    .recent-post-item * {
      color: var(--anzhiyu-fontcolor) !important;
    }
    
    /* 悬停效果同步 */
    .recent-post-item:hover .recent-post-info .article-title,
    .recent-post-item:hover .recent-post-info h2 {
      color: var(--anzhiyu-lighttext) !important;
      transition: color 0.3s ease;
      text-shadow: 0 0 5px rgba(242, 185, 75, 0.3);
    }
  }
}

/* ================= 移动端优化 ================= */
@media screen and (max-width: 768px) {
  #cover-block {
    height: 90vh;
    padding: 0 1rem;
  }
  
  .cover-title {
    font-size: 2.5rem;
  }
  
  .cover-subtitle {
    font-size: 1.4rem;
  }
  
  .cover-content {
    padding: 1.5rem;
    width: 90%;
    /* backdrop-filter: blur(5px); */
  }
  
  .recent-post-item {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
  }
}

/* ================= 打印样式优化 ================= */
@media print {
  #web_bg {
    display: none;
  }
  .recent-post-item {
    background: #fff !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}