/* ========================================
   自定义样式 - 徐倩怡的博客
   ======================================== */

/* ---- 1. 首页文章：左图右文卡片布局 ---- */

/* 文章卡片容器 */
#recent-posts .recent-post-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

#recent-posts .recent-post-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* 左侧封面图 */
#recent-posts .recent-post-item .post_cover {
  flex: 0 0 300px;
  width: 300px;
  height: 200px;
  overflow: hidden;
  margin: 0 !important;
  border-radius: 12px 0 0 12px;
}

#recent-posts .recent-post-item .post_cover img.post-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

#recent-posts .recent-post-item:hover .post_cover img.post-bg {
  transform: scale(1.05);
}

/* 右侧内容区 */
#recent-posts .recent-post-item .recent-post-info {
  flex: 1;
  padding: 24px 28px;
  min-width: 0;
}

/* 文章标题 */
#recent-posts .recent-post-item .recent-post-info .article-title {
  font-size: 1.35em;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--font-color);
  text-decoration: none;
  display: block;
  transition: color 0.2s;
}

#recent-posts .recent-post-item .recent-post-info .article-title:hover {
  color: var(--theme-color, #49B1F5);
}

/* 文章元信息（日期、分类） */
#recent-posts .recent-post-item .recent-post-info .article-meta-wrap {
  font-size: 0.85em;
  color: var(--font-meta-color, #858585);
  margin-bottom: 10px;
}

#recent-posts .recent-post-item .recent-post-info .article-meta-wrap i {
  margin-right: 4px;
}

#recent-posts .recent-post-item .recent-post-info .article-meta-wrap .article-meta-label {
  margin-right: 12px;
}

#recent-posts .recent-post-item .recent-post-info .article-meta-wrap .article-meta-separator {
  margin: 0 8px;
}

/* 分类标签链接 */
#recent-posts .recent-post-item .recent-post-info .article-meta-wrap .article-meta__categories {
  color: var(--theme-color, #49B1F5);
  text-decoration: none;
}

/* 文章摘要 */
#recent-posts .recent-post-item .recent-post-info .content {
  font-size: 0.93em;
  line-height: 1.7;
  color: var(--secondtext-color, #666);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 2. 响应式：小屏幕时堆叠为上下结构 ---- */
@media screen and (max-width: 768px) {
  #recent-posts .recent-post-item {
    flex-direction: column !important;
  }

  #recent-posts .recent-post-item .post_cover {
    flex: none;
    width: 100%;
    height: 200px;
    border-radius: 12px 12px 0 0;
  }

  #recent-posts .recent-post-item .recent-post-info {
    padding: 16px 20px;
  }
}

/* ---- 3. 防复制保护 ---- */

/* 禁止文字选择（除输入框和代码块外） */
body.protected :not(input):not(textarea):not(code):not(pre) {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* 禁止图片拖动 */
body.protected img {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  pointer-events: none !important;
}

/* ---- 4. 书籍页面样式 ---- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

.book-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}

.book-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.book-card .book-cover {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f5f5f5;
}

.book-card .book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-card .book-info {
  padding: 16px 18px 20px;
}

.book-card .book-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}

.book-card .book-title a {
  color: var(--font-color);
  text-decoration: none;
}

.book-card .book-title a:hover {
  color: var(--theme-color, #49B1F5);
}

.book-card .book-author {
  font-size: 0.88em;
  color: var(--font-meta-color, #888);
  margin-bottom: 8px;
}

.book-card .book-desc {
  font-size: 0.9em;
  line-height: 1.6;
  color: var(--secondtext-color, #666);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card .book-links {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.book-card .book-links a {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.82em;
  border-radius: 4px;
  background: var(--theme-color, #49B1F5);
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.book-card .book-links a:hover {
  opacity: 0.85;
}
