/* =============================================
   works/blog.css — 日记 / 随笔 共用布局
   左：标题目录（日记可加日历）| 右：正文（图+文）
   ============================================= */

html, body { overflow: hidden; height: 100%; }
.layout { display: flex; height: 100vh; min-height: 0; }

.main.blog-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 100px 0 0 0;
}

.blog-top {
  flex-shrink: 0;
  padding: 0 40px 16px 40px;
}
.blog-top .breadcrumb {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.blog-top .breadcrumb .current { color: var(--purple); }
.blog-top .breadcrumb .sep { margin: 0 8px; opacity: 0.4; }
.blog-top .breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.blog-top .breadcrumb a:hover { color: var(--purple); }

.blog-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 0;
  border-top: 1px solid rgba(192,136,200,0.12);
}

/* ── 左侧栏：与页面底色一致，不单独加深 ── */
.blog-aside {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(192,136,200,0.1);
  background: transparent; /* 透出 body 深灰 */
}
.blog-aside-head {
  flex-shrink: 0;
  padding: 16px 18px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(232,232,232,0.45);
  text-transform: uppercase;
}

/* 日历（仅日记） */
.blog-calendar {
  flex-shrink: 0;
  padding: 0 14px 14px;
}
.blog-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(232,232,232,0.75);
}
.blog-cal-nav button {
  border: 1px solid rgba(192,136,200,0.25);
  background: transparent;
  color: rgba(232,232,232,0.55);
  width: 28px;
  height: 28px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}
.blog-cal-nav button:hover {
  color: var(--purple);
  border-color: var(--purple);
}
.blog-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}
.blog-cal-grid .dow {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(232,232,232,0.3);
  padding: 4px 0;
}
.blog-cal-grid .day {
  font-family: var(--font-display);
  font-size: 11px;
  color: rgba(232,232,232,0.35);
  padding: 6px 0;
  border-radius: 2px;
  border: none;
  background: transparent;
  cursor: default;
}
.blog-cal-grid .day.has-entry {
  color: rgba(232,232,232,0.9);
  cursor: pointer;
  background: transparent;
  transition: color 0.15s, background 0.15s;
}
.blog-cal-grid .day.has-entry:hover {
  color: var(--purple);
  background: rgba(255,255,255,0.04);
}
.blog-cal-grid .day.is-active {
  background: transparent;
  color: var(--purple);
  box-shadow: inset 0 0 0 1px rgba(192,136,200,0.45);
}
.blog-cal-grid .day.muted { opacity: 0.25; }

/* 标题目录 */
.blog-toc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(192,136,200,0.45) transparent;
}
.blog-toc::-webkit-scrollbar { width: 6px; }
.blog-toc::-webkit-scrollbar-thumb {
  background: rgba(192,136,200,0.4);
  border-radius: 3px;
}
.blog-toc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 14px 10px 18px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.blog-toc-item:hover {
  background: rgba(255,255,255,0.03);
}
.blog-toc-item:hover .toc-title {
  color: rgba(232,232,232,0.95);
}
/* 选中：紫色文字 + 右侧灰色箭头（与侧栏 ▶ 统一） */
.blog-toc-item.is-active {
  background: transparent;
}
.blog-toc-item .toc-main {
  flex: 1;
  min-width: 0;
}
.blog-toc-item .toc-date {
  display: block;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(232,232,232,0.35);
  margin-bottom: 3px;
}
.blog-toc-item .toc-title {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: rgba(232,232,232,0.78);
}
.blog-toc-item .toc-arrow {
  flex-shrink: 0;
  font-size: 8px;
  opacity: 0;
  color: rgba(255,255,255,0.35);
  transition: opacity 0.15s;
  line-height: 1;
  margin-right: 4px;
}
.blog-toc-item.is-active .toc-date {
  color: rgba(192,136,200,0.7);
}
.blog-toc-item.is-active .toc-title {
  color: var(--purple);
}
.blog-toc-item.is-active .toc-arrow {
  opacity: 0.4;
  color: rgba(255,255,255,0.4);
}
.blog-toc-empty {
  padding: 24px 18px;
  font-size: 13px;
  color: rgba(232,232,232,0.35);
  font-family: var(--font-body);
}

/* ── 右侧正文 ── */
.blog-reader {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding: 28px 48px 80px;
  scrollbar-width: thin;
  scrollbar-color: rgba(192,136,200,0.45) transparent;
}
.blog-reader::-webkit-scrollbar { width: 8px; }
.blog-reader::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(192,136,200,0.5), rgba(168,112,176,0.65));
  border-radius: 4px;
}

.blog-article { max-width: 42em; }
.blog-article .meta-date {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(192,136,200,0.65);
  margin-bottom: 10px;
}
.blog-article h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #e8e8e8;
  margin: 0 0 20px;
  line-height: 1.35;
}
.blog-article .cover {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  margin: 0 0 28px;
  border: 1px solid rgba(192,136,200,0.12);
}
.blog-article .body {
  font-family: var(--font-serif, var(--font-body));
  font-size: 15.5px;
  line-height: 2;
  color: rgba(232,232,232,0.82);
}
.blog-article .body p {
  margin: 0 0 1.1em;
}
.blog-article .body p:last-child { margin-bottom: 0; }
.blog-article .body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.2em 0;
  border: 1px solid rgba(192,136,200,0.1);
}
.blog-placeholder {
  padding: 48px 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(232,232,232,0.4);
  line-height: 1.8;
}

@media (max-width: 860px) {
  .blog-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .blog-aside {
    border-right: none;
    border-bottom: 1px solid rgba(192,136,200,0.12);
    max-height: 42vh;
  }
  .blog-reader { padding: 20px 20px 64px; }
  .blog-top { padding: 0 20px 12px; }
}
