/* ============================================
   DaydreamerBlog 自定义样式
   梦境配色 · 卡片悬浮 · 排版优化
   ============================================ */

:root {
  --dd-accent: #6a58e8;
  --dd-accent-light: #8a78ff;
  --dd-accent-bg: rgba(106, 88, 232, 0.08);
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(106, 88, 232, 0.25);
}

/* ---------- 主面板 ---------- */
#board {
  border-radius: 1rem;
  box-shadow: 0 6px 24px rgba(30, 34, 60, 0.08), 0 2px 6px rgba(30, 34, 60, 0.05);
}

html.dark #board,
body.dark #board {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- Banner 标语 ---------- */
#banner .banner-sub-title {
  text-shadow: 0 2px 18px rgba(10, 12, 32, 0.65);
  letter-spacing: 0.06em;
  font-weight: 300;
}

.slogan-title {
  text-shadow: 0 2px 24px rgba(10, 12, 32, 0.7);
  letter-spacing: 0.04em;
}

/* ---------- 首页文章卡片 ---------- */
.index-card {
  padding: 0.5rem 0.75rem;
  margin-left: -0.75rem;
  margin-right: -0.75rem;
  border-radius: 0.85rem;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.index-card:hover {
  background-color: var(--dd-accent-bg);
  box-shadow: 0 4px 20px rgba(106, 88, 232, 0.10);
}

.index-header a,
.index-header {
  transition: color 0.2s ease;
}

.index-card:hover .index-header a,
.index-card:hover a.index-header {
  color: var(--dd-accent) !important;
  text-decoration: none;
}

.index-img img {
  border-radius: 0.6rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.index-card:hover .index-img img {
  transform: scale(1.025);
  box-shadow: 0 10px 26px rgba(30, 34, 60, 0.22);
}

.index-btm a {
  transition: color 0.2s ease;
}

.index-btm a:hover {
  color: var(--dd-accent) !important;
}

/* ---------- 文章正文排版 ---------- */
.markdown-body {
  font-size: 1.06rem;
  line-height: 1.95;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.markdown-body p {
  margin: 0 0 1.15em;
  text-align: justify;
}

.markdown-body li {
  margin: 0.35em 0;
  text-align: justify;
}

.markdown-body li > p {
  margin-bottom: 0.4em;
}

.markdown-body img {
  display: block;
  margin: 1.6em auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.8em;
  transition: color 0.2s ease;
}

.markdown-body h2 {
  line-height: 1.35;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line-color);
}

.markdown-body h3 {
  line-height: 1.4;
}

.markdown-body p {
  margin-bottom: 1.1em;
}

.markdown-body img {
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(30, 34, 60, 0.12);
  transition: box-shadow 0.3s ease;
}

.markdown-body img:hover {
  box-shadow: 0 8px 26px rgba(30, 34, 60, 0.2);
}

.markdown-body blockquote {
  border-left: none;
  border-radius: 0.4rem;
  padding: 0.7em 1.2em;
  background: var(--dd-accent-bg);
  color: inherit;
}

/* ---------- 代码块 ---------- */
.markdown-body figure.highlight,
.markdown-body pre {
  border-radius: 0.6rem;
}

.markdown-body figure.highlight {
  box-shadow: 0 4px 14px rgba(30, 34, 60, 0.1);
}

/* ---------- 链接与按钮 ---------- */
a {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

button,
.btn {
  transition: all 0.2s ease;
}

/* ---------- 文章头部 ---------- */
#seo-header {
  font-size: 2rem;
  line-height: 1.4;
  border-bottom: none;
  position: relative;
  padding-bottom: 0.55em;
  margin-bottom: 1.6em;
}

#seo-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 3.2rem;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--dd-accent), var(--dd-accent-light));
}

/* Banner 上的文章元信息：居中、胶囊化 */
#banner .banner-text .mt-3,
#banner .banner-text .mt-1 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
}

#banner .post-meta {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--subtitle-color);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}

#banner .post-meta i {
  margin-right: 0.35em;
  opacity: 0.9;
}

/* 标题锚点跳转时不被导航遮挡 */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  scroll-margin-top: 5rem;
}

/* ---------- 上一篇 / 下一篇卡片 ---------- */
.post-prevnext {
  gap: 1rem;
  margin-top: 2rem !important;
  align-items: stretch;
}

.post-prevnext .post-prev,
.post-prevnext .post-next {
  flex: 1 1 0;
  max-width: 50%;
  min-height: 76px;
}

.post-prevnext a,
.post-prevnext .no-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line-color);
  border-radius: 0.8rem;
  background: transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease,
    box-shadow 0.25s ease, transform 0.25s ease;
}

.post-prevnext .no-nav {
  border-style: dashed;
  color: var(--sec-text-color);
  font-size: 0.88rem;
  justify-content: center;
  cursor: default;
}

.post-prevnext a:hover {
  border-color: var(--dd-accent);
  background: var(--dd-accent-bg);
  box-shadow: 0 8px 20px rgba(106, 88, 232, 0.13);
  transform: translateY(-2px);
  text-decoration: none;
}

.post-prevnext a .hidden-mobile {
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}

.post-prev-next-label {
  display: block;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--sec-text-color);
  margin-bottom: 0.25rem;
  white-space: nowrap;
}

.post-prevnext a .hidden-mobile::before {
  content: "";
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--sec-text-color);
  margin-bottom: 0.25rem;
}

.post-prev a .hidden-mobile::before {
  content: "上一篇";
}

.post-next a .hidden-mobile::before {
  content: "下一篇";
}

.post-prevnext i {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--sec-text-color);
  background: rgba(106, 88, 232, 0.08);
  transition: all 0.25s ease;
}

.post-prevnext a:hover i {
  color: #ffffff;
  background: var(--dd-accent);
}

.post-next {
  justify-content: flex-end;
}

@media (max-width: 575px) {
  .post-prev, .post-next {
    flex: 1 1 100% !important;
    max-width: 100% !important;
  }

  .post-prevnext {
    flex-direction: column;
  }
}

/* ---------- 侧栏目录卡片 ---------- */
#toc {
  background: var(--board-bg-color);
  border: 1px solid var(--line-color);
  border-radius: 0.8rem;
  padding: 1rem 1.15rem 0.9rem;
  box-shadow: 0 4px 16px rgba(30, 34, 60, 0.06);
}

.toc-header {
  font-size: 1.05rem;
}

.toc-header i {
  color: var(--dd-accent);
}

.tocbot-link {
  transition: color 0.2s ease;
}

a.tocbot-link:hover {
  color: var(--dd-accent) !important;
  text-decoration: none;
}

.tocbot-active-link {
  color: var(--dd-accent) !important;
}

/* 移除主题的游离活动指示竖条（因缺少 position:relative 会脱离标题悬浮在列表左缘） */
.toc-list-item::before,
.toc-list-item.is-active-li::before {
  display: none !important;
  content: none !important;
}

/* 活动项改用颜色 + 缩进表达状态 */
.toc-list-item {
  transition: transform 0.2s ease;
  border-radius: 4px;
}

.toc-list-item.is-active-li {
  transform: translateX(4px);
}

.toc-toggle {
  transition: transform 0.2s ease, color 0.2s ease;
}

.toc-toggle:hover {
  color: var(--dd-accent);
}

/* ---------- 返回顶部按钮 ---------- */
#scroll-top-button {
  border-radius: 50% !important;
  box-shadow: 0 4px 16px rgba(30, 34, 60, 0.18);
  transition: background-color 0.25s ease, box-shadow 0.25s ease,
    bottom 0.3s ease;
}

#scroll-top-button:hover {
  background: var(--dd-accent) !important;
  box-shadow: 0 6px 20px rgba(106, 88, 232, 0.35);
}

#scroll-top-button:hover i {
  color: #ffffff !important;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
}

/* ---------- 页脚 ---------- */
#footer {
  background: transparent;
}

#footer a:hover {
  color: var(--dd-accent-light) !important;
}
