/* ============================================================
   Mist Theme — 素雅风格核心样式
   Copyright © 2026 MelMist
   ============================================================ */

/* --- 自定义字体 --- */
@font-face {
  font-family: 'Fahua Wenkai';
  src: url('../fonts/fahua-wenkai.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- CSS 变量 & 基础设置 --- */
:root {
  --bg:            #faf8f5;
  --bg-card:       #fffefb;
  --bg-header:     #3c3228;
  --bg-footer:     #2c2520;
  --text:          #2e241a;
  --text-light:    #6b5d4f;
  --text-secondary: #8a7d6f;
  --text-header:   #e8dcc8;
  --text-footer:   #b0a090;
  --link:          #8b4513;
  --link-hover:    #a0522d;
  --border:        #d4c5b2;
  --border-light:  #e8ddd0;
  --accent:        #8b7355;
  --code-bg:       #f0ebe3;
  --code-text:     #5c4a3a;
  --shadow:        0 2px 12px rgba(60, 40, 20, 0.06);
  --radius:        4px;
  --font-body:     Georgia, 'Times New Roman', 'Noto Serif SC', 'Source Han Serif SC', serif;
  --font-heading:  'Palatino Linotype', 'Book Antiqua', Palatino, 'Noto Serif SC', serif;
  --font-mono:     'Courier New', Courier, 'Noto Sans Mono SC', monospace;
  --max-width:     800px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

::selection {
  background: var(--accent);
  color: #fff;
}
::-moz-selection {
  background: var(--accent);
  color: #fff;
}
html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* 细滚动条 */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c0b5a8;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9a8b7a;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

blockquote {
  margin: 1.2em 0;
  padding: 0.6em 1.2em;
  border-left: 4px solid var(--accent);
  background: var(--code-bg);
  color: var(--text-light);
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1em 1.2em;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
  margin: 1.2em 0;
  border: 1px solid var(--border-light);
}
pre code {
  background: none;
  padding: 0;
}

/* --- 排版 --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin: 1.5em 0 0.6em;
}
h1 { font-size: 1.6em; }
h2 { font-size: 1.35em; }
h3 { font-size: 1.15em; }
h4 { font-size: 1.05em; }

p { margin: 0.8em 0; }

ul, ol {
  margin: 0.6em 0;
  padding-left: 1.6em;
}
li { margin: 0.25em 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.9em;
}
th, td {
  padding: 0.5em 0.8em;
  border: 1px solid var(--border);
  text-align: left;
}
th {
  background: var(--code-bg);
  font-weight: 700;
}

/* --- 头部 --- */
.site-header {
  background: var(--bg-header);
  color: var(--text-header);
  padding: 1.8rem 1rem 1.2rem;
  text-align: center;
  border-bottom: 4px solid var(--accent);
  font-family: 'Fahua Wenkai', var(--font-heading);
}
.site-header a {
  color: var(--text-header);
}
.site-header a:hover {
  color: #fff;
  text-decoration: none;
}

.site-title {
  font-family: 'Fahua Wenkai', var(--font-heading);
  font-size: 3.4rem;
  font-weight: normal;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.site-logo {
  max-height: 60px;
  width: auto;
}
.site-title a {
  color: #fff;
}
.site-title a:hover {
  color: var(--text-header);
}

.site-description {
  font-family: 'Fahua Wenkai', var(--font-heading) !important;
  font-size: 0.9rem;
  color: var(--text-footer);
  margin: 0 0 1rem;
}

/* --- 导航 --- */
.site-nav {
  margin-top: 0.4rem;
  font-family: var(--font-body);
  position: relative;
}
.site-nav.has-divider::before {
  content: '';
  position: absolute;
  top: -0.4rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}
.site-nav a {
  display: inline-block;
  font-size: 0.92rem;
  color: var(--text-header);
  transition: color 0.2s ease;
}
.site-nav a:not(:last-child)::after {
  content: ' | ';
  margin: 0 0.5rem;
  color: rgba(255,255,255,0.25);
}
.nav-dropdown a::after {
  display: none;
}
.site-nav a:hover,
.site-nav a.current {
  color: #fff;
  text-decoration: none;
}

/* --- 下拉菜单 --- */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.nav-dropdown-toggle {
  cursor: pointer;
}
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid #000;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  min-width: 120px;
  z-index: 1000;
  padding: 0.5rem 0;
}
.nav-dropdown-menu a {
  display: block;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
  color: #333 !important;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover {
  background: var(--bg-hover);
  color: var(--accent) !important;
}
.nav-dropdown-menu a:not(:last-child)::after {
  display: none;
}
.nav-dropdown.active .nav-dropdown-menu {
  display: block;
}

/* --- 主容器 --- */
.site-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 3.5rem auto;
  padding: 0 1rem;
}

/* --- 文章列表 & 单篇 --- */
.post {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed #000;
}
/* 样式二：文章详情页黑边框包裹 */
.post-style2 {
  background: var(--bg-card);
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
/* 样式三：文章详情页米黄色背景 */
.post-style3 {
  background: #faf6ed;
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.sticky-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1em 0.5em;
  border-radius: 3px;
  margin-right: 0.5em;
  vertical-align: middle;
}

.post-cover {
  margin-bottom: 1rem;
}
.post-cover img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* 样式二：封面在右侧 (200px) */
.post-cover-right {
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-rows: auto auto 1fr;
  gap: 0 1.5rem;
  align-items: start;
}
.post-cover-right .post-cover {
  grid-column: 2;
  grid-row: 1 / 4;
  margin-bottom: 0;
}
.post-cover-right .post-cover img {
  max-height: none;
}
.post-cover-right .post-title {
  grid-column: 1;
  grid-row: 1;
}
.post-cover-right .post-meta {
  grid-column: 1;
  grid-row: 2;
}
.post-cover-right .post-content {
  grid-column: 1;
  grid-row: 3;
}

/* 样式四：封面在左侧 */
.post-cover-left {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto 1fr;
  gap: 0 1.5rem;
  align-items: start;
}
.post-cover-left .post-cover {
  grid-column: 1;
  grid-row: 1 / 4;
  margin-bottom: 0;
}
.post-cover-left .post-cover img {
  max-height: none;
}
.post-cover-left .post-title {
  grid-column: 2;
  grid-row: 1;
}
.post-cover-left .post-meta {
  grid-column: 2;
  grid-row: 2;
}
.post-cover-left .post-content {
  grid-column: 2;
  grid-row: 3;
}

/* 样式三：封面在标题右侧，小图 (120px) */
.post-cover-thumb {
  display: grid;
  grid-template-columns: 1fr 120px;
  grid-template-rows: auto auto 1fr;
  gap: 0 1.2rem;
  align-items: start;
}
.post-cover-thumb .post-cover {
  grid-column: 2;
  grid-row: 1;
  margin-bottom: 0;
}
.post-cover-thumb .post-cover img {
  max-height: none;
  border-radius: 3px;
}
.post-cover-thumb .post-title {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}
.post-cover-thumb .post-meta {
  grid-column: 1 / -1;
  grid-row: 2;
}
.post-cover-thumb .post-content {
  grid-column: 1 / -1;
  grid-row: 3;
}

/* 移动端适配 - 保持封面样式与桌面端一致 */
@media (max-width: 600px) {
  /* 封面右侧样式 - 移动端 */
  .post-cover-right {
    grid-template-columns: 1fr 100px;
    gap: 0 0.75rem;
  }
  .post-cover-right .post-cover {
    grid-row: 1 / 4;
  }
  .post-cover-right .post-cover img {
    max-height: 120px;
  }
  /* 封面缩略图样式 - 移动端 */
  .post-cover-thumb {
    grid-template-columns: 80px 1fr;
  }
  .post-cover-thumb .post-cover {
    grid-row: 1 / 4;
  }
  .post-cover-thumb .post-cover img {
    max-height: 80px;
  }
  /* 封面左侧样式 - 移动端 */
  .post-cover-left {
    grid-template-columns: 100px 1fr;
    gap: 0 0.75rem;
  }
  .post-cover-left .post-cover {
    grid-row: 1 / 4;
  }
  .post-cover-left .post-cover img {
    max-height: 120px;
  }
  /* 极简列表 - 移动端日期放标题下方 */
  .post-minimal .post-meta {
    width: 100%;
    margin-left: 0;
  }
  .post-minimal .post-meta-right {
    margin-left: 0;
  }
}

/* 极简列表样式 */
.post-minimal {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6em 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}
.post-minimal .post-title {
  margin: 0;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.post-minimal .post-title a {
  color: #1e1810;
}
.post-minimal .post-meta {
  margin: 0;
  flex-shrink: 0;
}
.post-minimal .post-meta-right {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-light);
  flex-shrink: 0;
}
.post-minimal .post-meta-right a {
  display: inline-block;
  margin: 0 0.15em;
  padding: 0.1em 0.5em;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 0.8rem;
}
.post-minimal .post-meta-right a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.post-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  line-height: 1.35;
}
.post-title a {
  color: #1e1810;
}
h1.post-title {
  font-size: 2rem;
  font-weight: 800;
}
.post-title a:hover {
  color: var(--link);
  text-decoration: none;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1.2rem;
  font-style: italic;
}
.post-meta span {
  margin-right: 0.8em;
}
.post-meta a {
  color: var(--text-light);
}
.post-meta a:hover {
  color: var(--link);
}

.post-content {
  line-height: 1.85;
  word-wrap: break-word;
  font-size: 1.05rem;
}

/* 文章目录 */
.post-toc-toggle {
  position: fixed;
  left: 1.5rem;
  top: 17rem;
  z-index: 11;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 6px;
  line-height: 1;
}
.post-toc-toggle:hover {
  color: var(--accent);
}
.post-toc {
  position: fixed;
  left: 1.5rem;
  top: calc(17rem + 2rem);
  width: 220px;
  font-size: 0.95rem;
  max-height: calc(100vh - 21rem);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: opacity 0.35s ease, max-height 0.35s ease;
}
.post-toc-title {
  flex-shrink: 0;
}
.post-toc-list {
  padding-top: 0.8rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  height: 420px;
  max-height: calc(100vh - 25rem);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0px, black 10px, black calc(100% - 10px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0px, black 10px, black calc(100% - 10px), transparent 100%);
}
.post-toc-list::-webkit-scrollbar {
  display: none;
  transition: opacity 0.35s ease, max-height 0.35s ease;
}
.post-toc.collapsed {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
}
.post-toc-title {
  font-weight: 600;
  margin-bottom: 0.6rem;
  font-size: 1rem;
}
.post-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-toc li {
  margin-bottom: 0.4rem;
  line-height: 1.5;
}
.post-toc li.toc-h3 {
  padding-left: 1em;
}
.post-toc a {
  color: #333;
  text-decoration: none;
}
.post-toc a:hover {
  color: var(--accent);
}
@media (max-width: 900px) {
  .post-toc {
    display: none;
  }
}

.post-content .more-link {
  display: inline-block;
  margin-top: 0.6em;
  font-style: italic;
  color: var(--link);
}
.post-content .more-link::after {
  content: ' →';
}

.post-divider {
  border: none;
  border-top: 1px dashed #000;
  margin: 0.8rem 0 1.5rem;
}

/* --- 标签 --- */
.tags {
  margin-top: 1.5em;
  padding-top: 1em;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-light);
}
.tags a {
  display: inline-block;
  margin: 0 0.2em;
  padding: 0.15em 0.6em;
  background: var(--code-bg);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 0.82rem;
}
.tags a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

/* 详情页标签覆盖（横线上方，无边框） */
.post-tags-inline {
  margin-top: 0.4em !important;
  padding-top: 0 !important;
  border-top: none !important;
}
.post-tags-inline a {
  background: transparent;
}

/* --- 分页 --- */
.page-navigator {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 0.3em;
  flex-wrap: wrap;
  margin: 2rem 0;
}
.page-navigator li {
  margin: 0;
}
.page-navigator a,
.page-navigator span {
  display: inline-block;
  padding: 0.4em 0.8em;
  border: 1px solid #000;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-card);
  transition: all 0.2s ease;
}
.page-navigator a:hover {
  background: var(--accent);
  color: #fff;
  border-color: #000;
  text-decoration: none;
}
.page-navigator .current {
  background: var(--accent);
  color: #fff;
  border-color: #000;
  font-weight: 700;
}

/* --- 归档标题 --- */
.archive-title {
  background: var(--bg-card);
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.archive-title h1 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin: 0;
  color: var(--accent);
}

/* --- 归档页面统计概览 --- */
.archive-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px dashed var(--border-light);
}
.archive-stat-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0.8rem 0;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(to right, #000 12px, transparent 12px) 0 0 / 12px 1px no-repeat,
    linear-gradient(to bottom, #000 12px, transparent 12px) 0 0 / 1px 12px no-repeat,
    linear-gradient(to left, #000 12px, transparent 12px) 100% 0 / 12px 1px no-repeat,
    linear-gradient(to bottom, #000 12px, transparent 12px) 100% 0 / 1px 12px no-repeat,
    linear-gradient(to right, #000 12px, transparent 12px) 0 100% / 12px 1px no-repeat,
    linear-gradient(to top, #000 12px, transparent 12px) 0 100% / 1px 12px no-repeat,
    linear-gradient(to left, #000 12px, transparent 12px) 100% 100% / 12px 1px no-repeat,
    linear-gradient(to top, #000 12px, transparent 12px) 100% 100% / 1px 12px no-repeat,
    var(--bg-card);
}
.archive-stat-item::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid #000;
  opacity: 0.35;
  pointer-events: none;
}
.archive-stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--accent);
  line-height: 1.2;
}
.archive-stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 0.2rem;
}

/* --- 归档页面分类统计 --- */
.archive-categories {
  margin-bottom: 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px dashed var(--text-light);
}
.archive-cat-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
  color: var(--text);
}
.archive-cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.archive-cat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.35em 1em;
  border: 1px solid #000;
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}
.archive-cat-item:hover {
  border-color: var(--accent);
  background: var(--bg-card);
  color: var(--accent);
}
.archive-cat-count {
  font-size: 0.78rem;
  color: var(--text-light);
}
.archive-cat-item:hover .archive-cat-count {
  color: var(--accent);
}

/* --- 归档页面控件 --- */
.archive-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.archive-view-btn,
.archive-toggle-all {
  padding: 0.35em 0.9em;
  border: 1px solid #000;
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.archive-view-btn:hover,
.archive-toggle-all:hover {
  background: var(--accent);
  color: #fff;
  border-color: #000;
}
.archive-view-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: #000;
  font-weight: 600;
}
.archive-toggle-all {
  margin-left: auto;
}

/* --- 归档视图容器 --- */
.archive-view {
  display: none;
}
.archive-view.active {
  display: block;
}

/* --- 年份 / 月份分组 --- */
.archive-year-group {
  margin-bottom: 1.5rem;
}
.archive-month-group {
  margin-left: 0;
}

/* --- 可折叠标题 --- */
.archive-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 0.3rem 0;
  transition: color 0.2s ease;
}
.archive-header:hover {
  color: var(--accent);
}
.archive-year-header {
  font-size: 1.3rem;
  color: var(--accent);
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}
.archive-month-header {
  font-size: 1rem;
  color: var(--text-light);
  margin-top: 0.8rem;
  margin-bottom: 0.3rem;
}

/* --- 折叠图标 --- */
.archive-toggle {
  display: inline-block;
  font-size: 0.75em;
  transition: transform 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}
.archive-header.collapsed .archive-toggle {
  transform: rotate(-90deg);
}

/* --- 文章计数 --- */
.archive-count {
  font-size: 0.78em;
  color: var(--text-light);
  font-weight: 400;
}

/* --- 折叠内容 --- */
.archive-body.collapsed {
  display: none;
}

/* --- 文章列表 --- */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 0.2rem 0 0.5rem 0.8rem;
}
.archive-list li {
  display: flex;
  align-items: center;
  padding: 0.3em 0;
  border-bottom: 1px dotted var(--text-light);
  font-size: 0.92rem;
}
.archive-list li > a {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-list li:last-child {
  border-bottom: 1px dotted var(--text-light);
}
.archive-date {
  display: inline-block;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-right: 0.8rem;
  min-width: 3em;
}
.archive-views {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-left: 0.5rem;
  white-space: nowrap;
}
.archive-item-tags {
  margin-left: 0.5rem;
  white-space: nowrap;
}
.archive-item-tags a {
  display: inline-block;
  padding: 0.05em 0.25em;
  margin: 0 0.08em;
  font-size: 0.72rem;
  border-radius: var(--radius);
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}
.archive-item-tags a:hover {
  color: var(--accent);
}

/* 月份视图微调 */
.archive-view-month .archive-month-header {
  font-size: 1.05rem;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.3rem;
  margin-bottom: 0.4rem;
}
.archive-view-month .archive-month-group {
  margin-bottom: 1.2rem;
}

/* --- 前后文章导航 --- */
.post-near {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  font-size: 0.88rem;
}
.post-near a {
  max-width: 48%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* --- 评论区 (Create 风格) --- */
.mist-comments {
  border: 1px solid #000;
  padding: 2rem;
}

/* 评论列表 */
.mist-comment-count {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d2520;
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 1.5em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}
.mist-comment-count svg {
  color: #8b7355;
}
ol.mist-comment-list {
  list-style: none !important;
  list-style-type: none !important;
  counter-reset: none !important;
  counter-increment: none !important;
  padding: 0;
  margin: 0;
}
.mist-comment-list li {
  list-style: none !important;
  list-style-type: none !important;
}
.mist-comment-list .comment-body {
  padding: 1.2em 0;
  border-bottom: 1px solid rgba(139, 115, 85, 0.7);
}
.mist-comment-list .comment-body:last-child {
  border-bottom: none;
}
.mist-comment-list .comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5em;
}
.mist-comment-list .comment-head-left {
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.mist-comment-list .comment-head-left .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.mist-comment-list .comment-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: #2d2520;
}
.mist-comment-list .comment-name a {
  color: #2d2520;
  text-decoration: none;
  transition: color 0.2s;
}
.mist-comment-list .comment-name a:hover {
  color: #8b7355;
}
.mist-comment-list .comment-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 8px;
  border: 1px solid #8b7355;
  color: #8b7355;
  font-family: var(--font-body);
  font-weight: 400;
}
.mist-comment-list .comment-time {
  font-size: 0.72rem;
  color: rgba(139, 115, 85, 0.55);
  white-space: nowrap;
}
.mist-comment-list .comment-text {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #4a3f35;
}
.mist-comment-list .comment-action {
  margin-top: 0.5em;
}
.mist-comment-list .comment-action a {
  font-size: 0.75rem;
  color: #8b7355;
  text-decoration: none;
  transition: color 0.2s;
}
.mist-comment-list .comment-action a:hover {
  color: #4a3f35;
}
.mist-comment-list .comment-children {
  list-style: none;
  margin-top: 0.5em;
  padding-left: 1.5em;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(139, 115, 85, 0.8) 0px,
    rgba(139, 115, 85, 0.8) 3px,
    transparent 3px,
    transparent 6px
  );
  background-position: left top;
  background-size: 2px 100%;
  background-repeat: repeat-y;
  border-left: none;
  padding-left: 6px;
}
.mist-comment-list .comment-children .comment-body {
  border-bottom: none;
  padding: 0.6em 0 0;
}
.mist-comment-list .comment-children .comment-body + .comment-body {
  margin-top: 0.8em;
}
.mist-comment-list .comment-by-author > div > .comment-head .comment-name {
  color: #8b7355;
}

/* 分页 */
.mist-comments .page-navigator {
  display: flex;
  gap: 0.5em;
  margin-top: 1.5em;
  font-size: 0.85rem;
}
.mist-comments .page-navigator a,
.mist-comments .page-navigator .current {
  padding: 0.3em 0.8em;
  border: 1px solid rgba(139, 115, 85, 0.2);
  color: #8b7355;
  text-decoration: none;
  transition: all 0.2s;
}
.mist-comments .page-navigator a:hover {
  background: rgba(139, 115, 85, 0.08);
}
.mist-comments .page-navigator .current {
  background: #8b7355;
  color: #fff;
}

/* 评论关闭 */
.mist-closed {
  color: rgba(139, 115, 85, 0.55);
  font-size: 0.9rem;
}

/* --- 评论表单 --- */
.mist-respond {
  margin-bottom: 2.5em;
  padding-bottom: 2em;
  border-bottom: 1px solid rgba(139, 115, 85, 0.15);
}
.mist-respond-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d2520;
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 1.2em;
}
.mist-respond-title svg {
  color: #8b7355;
}

/* 三列输入行 */
.mist-input-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8em;
}
@media (max-width: 500px) {
  .mist-input-row {
    flex-direction: column;
    gap: 0.8em;
  }
}

.mist-input-col {
  flex: 1;
  min-width: 0;
}
.mist-textarea-col {
  margin-bottom: 1em;
}
.mist-input-col label,
.mist-textarea-col label {
  display: flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.8rem;
  color: rgba(139, 115, 85, 0.7);
  margin-bottom: 0.35em;
}
.mist-input-col label svg,
.mist-textarea-col label svg {
  opacity: 0.7;
}
.mist-required {
  color: #c33;
}
.mist-input-col input,
.mist-textarea-col textarea {
  width: 100%;
  padding: 0.55em 0.7em;
  border: 1px solid rgba(139, 115, 85, 0.2);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: #2d2520;
  transition: border-color 0.2s ease;
  resize: vertical;
}
.mist-input-col input:focus,
.mist-textarea-col textarea:focus {
  outline: none;
  border-color: #8b7355;
}
.mist-textarea-col textarea {
  min-height: 110px;
}

/* 已登录提示 */
.mist-logged-in {
  font-size: 0.85rem;
  color: rgba(139, 115, 85, 0.7);
  margin: 0 0 1em;
}
.mist-logged-in a {
  color: #8b7355;
}

/* 提交按钮 */
.mist-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5em 1.4em;
  background: #8b7355;
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.mist-submit:hover {
  background: #6b5544;
}

/* 取消回复 */
.mist-cancel-reply {
  margin-left: 0.6em;
  font-size: 0.85rem;
  color: #8b7355;
  cursor: pointer;
}

/* --- 搜索框 --- */
.search-form {
  display: flex;
  margin: 1.2rem 0 0;
  justify-content: center;
}
.search-form input[type="text"] {
  padding: 0.45em 0.8em;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  width: 320px;
}
.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.search-form button {
  padding: 0.45em 0.9em;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.search-form button:hover {
  background: var(--link-hover);
}

/* --- 页脚 --- */
.site-footer {
  background: var(--bg-footer);
  color: var(--text-footer);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.82rem;
  margin-top: auto;
  border-top: 4px solid var(--accent);
}
.site-footer a {
  color: var(--text-header);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}
.site-footer a:hover {
  color: #fff;
}

/* --- 404 --- */
.error-page {
  text-align: center;
  padding: 3rem 0;
}
.error-page h2 {
  font-size: 3rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.error-page p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

/* --- 灯箱 --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay.active {
  display: flex;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 2px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover {
  opacity: 1;
}

/* --- 侧边栏布局 --- */
.site-body {
  /* 无侧边栏时，仅作为透传容器 */
}
.site-body.has-sidebar {
  display: flex;
  gap: 3rem;
  justify-content: center;
  padding: 0 1rem;
}
.site-body.has-sidebar .site-main {
  flex: 1 1 0;
  min-width: 0;
  max-width: var(--max-width);
  margin: 3.5rem 0;
  padding: 0;
}
.site-sidebar {
  width: 260px;
  flex-shrink: 0;
  margin-top: 2.5rem;
}
.widget-blogger .blogger-card {
  text-align: center;
}
.widget-blogger .blogger-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-light);
  margin-bottom: 0.6rem;
}
.widget-blogger .blogger-name {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.widget-blogger .blogger-bio {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.widget-blogger .blogger-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.widget-blogger .blogger-links a {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.widget-blogger .blogger-links a:hover {
  color: var(--accent);
}
.widget-blogger .blogger-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.widget-blogger .blogger-icon-link:hover .blogger-icon {
  opacity: 1;
}
.widget-custom {
  width: fit-content;
  min-width: 100%;
  overflow: visible;
}
.widget {
  background: #F6F4EC;
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.widget-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}
.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
}
.widget-list li {
  padding: 0.35em 0;
  border-bottom: 1px dotted var(--border-light);
}
.widget-list li:last-child {
  border-bottom: none;
}
.widget-list a {
  color: var(--text);
}
.widget-list a:hover {
  color: var(--link);
  text-decoration: none;
}
.widget-tag-cloud {
  line-height: 2;
}
.widget-tag-cloud a {
  display: inline-block;
  margin: 0 0.3em 0.3em 0;
  padding: 0.15em 0.5em;
  background: var(--code-bg);
  border-radius: var(--radius);
  color: var(--text-light);
  font-size: 0.85rem;
}
.widget-tag-cloud a:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.widget-sticky {
  position: sticky;
  top: 1rem;
}
.widget-no-border {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 0.5rem;
}

@media (max-width: 900px) {
  .site-body.has-sidebar {
    flex-direction: column;
  }
  .site-body.has-sidebar .site-main {
    flex: none;
    max-width: none;
    margin: 1.5rem 0 0;
  }
  .site-sidebar {
    width: 100%;
    margin-top: 0;
  }
  .search-form input[type="text"] {
    width: 180px;
  }
}

/* --- 相关文章 --- */
.related-posts {
  border: 1px solid #000;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
/* 样式二、三时文章详情页才有白底背景 */
.post-style2 + .related-posts {
  background: var(--bg-card);
}
.post-style3 + .related-posts {
  background: #faf6ed;
}
.related-posts h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin: 0 0 0.8rem;
  color: var(--accent);
}
.related-posts ul {
  list-style: none;
  padding: 0;
}
.related-posts li {
  padding: 0.4em 0;
  border-bottom: 1px dotted #000;
}
.related-posts li:last-child {
  border-bottom: none;
}
.related-posts li span {
  margin-left: 0.5em;
}


/* --- 作者徽章 --- */
.author-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 400;
  padding: 0.1em 0.5em;
  background: var(--accent);
  color: #fff;
  border-radius: 3px;
  margin-left: 0.3em;
  vertical-align: middle;
}

/* --- 返回顶部 --- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  transform: translateX(80px);
  transition: transform 0.3s ease;
  z-index: 999;
}
.back-to-top:hover {
  opacity: 1;
}
.back-to-top.visible {
  transform: translateX(0);
}

/* --- 响应式 --- */
@media (max-width: 600px) {
  html { font-size: 15px; }

  .site-header {
    padding: 1.2rem 0.8rem 0.8rem;
  }
  .site-title {
    font-size: 2.2rem;
  }
  .site-logo {
    max-height: 36px;
  }

  .site-nav a {
    margin: 0 0.15em;
  }

  .post-near {
    flex-direction: column;
    gap: 0.5em;
  }
  .post-near a {
    max-width: 100%;
  }

  .mist-comment-list .comment-children {
    padding-left: 1em;
  }

  .site-main {
    margin: 1.5rem auto;
  }
}
