/* ── Fix 1: Card hover 不透明 ── */
.dream-grid .card:hover {
  background-color: oklch(var(--b1)) !important;
  border-color: oklch(var(--bc) / 0.3) !important;
}

html.dark .dream-grid .card:hover {
  background-color: oklch(var(--b1)) !important;
  border-color: oklch(var(--bc) / 0.3) !important;
}

/* ── Fix 2: 文章详情页内容区域背景非透明 ── */
#dream-single-post-main {
  background-color: oklch(var(--b1));
  padding: 2rem;
  border-radius: 1rem;
}

@media (max-width: 1024px) {
  #dream-single-post-main {
    padding: 1.25rem;
  }
}

html.dark #dream-single-post-main {
  background-color: oklch(var(--b1));
}

/* ── Fix 3: 宽屏下内容区自适应 ── */
@media (min-width: 1024px) {
  /* grid 改 flex，内容撑满，TOC固定200px */
  .lg\:grid-cols-4 {
    display: flex !important;
    flex-direction: row;
    gap: 1.5rem;
    align-items: flex-start;
  }

  /* 隐藏左侧空白列 */
  .lg\:grid-cols-4 > div:first-child {
    display: none !important;
  }

  /* 内容区自适应 */
  .lg\:col-span-2 {
    flex: 1;
    min-width: 0;
    max-width: min(85vw, 960px);
    margin: 0 auto;
  }

  /* TOC固定200px */
  .lg\:grid-cols-4 > div:last-child {
    display: block !important;
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 1rem;
  }
}

@media (min-width: 1600px) {
  .lg\:col-span-2 {
    max-width: 1100px;
  }
}

/* ── 内容区表格和图片自适应 ── */
#dream-single-post-content table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

@media (min-width: 768px) {
  #dream-single-post-content table {
    white-space: normal;
  }
}

#dream-single-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

#dream-single-post-content pre {
  max-width: 100%;
  overflow-x: auto;
}
