/* Single post specific styles */
:root { --single-max-width: 880px; }
.single .layout-main .container { max-width:var(--single-max-width); }

.single-header { margin-bottom:34px; text-align:center; }
.single-header .single-title { font-size:2.3rem; line-height:1.25; margin:0 0 14px; font-weight:700; letter-spacing:.5px; }
.single-meta { display:flex; flex-wrap:wrap; gap:14px 22px; justify-content:center; font-size:.78rem; color:var(--text-secondary); }
.single-meta span { display:inline-flex; align-items:center; gap:4px; }
.single-meta i { font-size:.85rem; opacity:.82; }

.single-feature { margin:0 auto 34px; border-radius:20px; overflow:hidden; aspect-ratio:16/8; position:relative; background:#f2f4f3; }
[data-theme="dark"] .single-feature { background:#222; }
.single-feature img { width:100%; height:100%; object-fit:cover; display:block; }

.single-content { font-size:1rem; line-height:1.8; color:var(--text-primary); }

/* 标题样式优化 - 强制优先级 */
.post-body h1,
.single-content h1 { 
  font-size: 1.5rem !important; 
  font-weight: 700 !important; 
  margin: 2em 0 0.8em !important; 
  line-height: 1.3 !important; 
  color: #333 !important; 
  border-bottom: 2px solid #e8e8e8 !important; 
  padding-bottom: 0.4em !important; 
}

.post-body h2,
.single-content h2 { 
  font-size: 1.3rem !important; 
  font-weight: 600 !important; 
  margin: 1.8em 0 0.8em !important; 
  line-height: 1.35 !important; 
  color: #444 !important; 
  border-left: 4px solid var(--main-color) !important; 
  padding-left: 0.6em !important; 
}

.post-body h3,
.single-content h3 { 
  font-size: 1.2rem !important; 
  font-weight: 600 !important; 
  margin: 1.5em 0 0.6em !important; 
  line-height: 1.4 !important; 
  color: #555 !important; 
}

.post-body h4,
.single-content h4 { 
  font-size: 1.1rem !important; 
  font-weight: 600 !important; 
  margin: 1.3em 0 0.5em !important; 
  line-height: 1.4 !important; 
  color: #666 !important; 
}

.post-body h5,
.single-content h5 { 
  font-size: 1rem !important; 
  font-weight: 600 !important; 
  margin: 1.1em 0 0.4em !important; 
  line-height: 1.4 !important; 
  color: #777 !important; 
}

.single-content p { margin:1em 0; }

/* 文章内容区域 */
.post-content {
  position: relative;
  max-width: 100%;
}

/* 右侧目录样式 */
.post-toc-sidebar {
  position: fixed;
  top: 100px;
  right: 70px;
  width: 200px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  max-height: calc(100vh - 120px);
  z-index: 999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.toc-header {
  padding: 8px 12px;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.toc-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-align: center;
}

.toc-content {
  padding: 8px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  margin: 0 0 2px 0;
  line-height: 1.3;
}

.toc-list a {
  display: block;
  padding: 4px 6px;
  color: #666;
  text-decoration: none;
  font-size: 11px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.toc-list a:hover {
  background: var(--main-color);
  color: white;
}

.toc-list a.active {
  background: var(--main-color);
  color: white;
  font-weight: 600;
}

.toc-list .toc-h1 { 
  padding-left: 6px; 
  font-weight: 600;
  font-size: 12px;
}
.toc-list .toc-h2 { 
  padding-left: 12px; 
}
.toc-list .toc-h3 { 
  padding-left: 18px; 
}
.toc-list .toc-h4 { 
  padding-left: 24px; 
}
.toc-list .toc-h5 { 
  padding-left: 30px; 
}
.toc-list .toc-h6 { 
  padding-left: 36px; 
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .post-toc-sidebar {
    position: fixed;
    top: 80px;
    right: 50px;
    width: 180px;
  }
}

@media (max-width: 768px) {
  .post-toc-sidebar {
    position: fixed;
    top: 70px;
    right: 30px;
    width: 160px;
    max-height: calc(100vh - 90px);
  }
  
  .toc-header {
    padding: 6px 8px;
  }
  
  .toc-header h3 {
    font-size: 11px;
  }
  
  .toc-content {
    padding: 6px;
    max-height: calc(100vh - 120px);
  }
  
  .toc-list a {
    font-size: 10px;
    padding: 3px 5px;
  }
}

@media (max-width: 480px) {
  .post-toc-sidebar {
    position: fixed;
    top: 60px;
    right: 5px;
    left: 5px;
    width: auto;
    max-height: calc(100vh - 80px);
  }
  
  .toc-content {
    padding: 4px;
  }
  
  .toc-list a {
    font-size: 9px;
    padding: 2px 4px;
  }
}

/* 链接样式优化 - 强制优先级 */
.single-content a { 
  color: var(--main-color) !important; 
  text-decoration: none !important; 
  position: relative !important; 
  border-bottom: 1px solid transparent !important; 
  transition: all 0.3s ease !important; 
  display: inline-block !important;
}

.single-content a:hover { 
  color: var(--dark-main-color) !important; 
  border-bottom-color: var(--main-color) !important; 
  transform: translateY(-1px) !important; 
  text-decoration: none !important;
}

/* 图片fancybox样式 */
.single-content img { 
  max-width: 100%; 
  height: auto; 
  border-radius: 8px; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); 
  transition: all 0.3s ease; 
  cursor: pointer; 
}

.single-content img:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); 
}

/* fancybox图片容器 */
.single-content .fancybox-container { 
  display: inline-block; 
  margin: 1em 0; 
}

.single-content .fancybox-container img { 
  display: block; 
  margin: 0 auto; 
}
.single-content pre { background:#1e1f22; color:#eee; padding:16px 18px; border-radius:14px; overflow:auto; font-size:.85rem; line-height:1.5; }
[data-theme="dark"] .single-content pre { background:#111; }
.single-content code { background:rgba(0,0,0,.06); padding:2px 6px; border-radius:6px; font-size:.85rem; }
[data-theme="dark"] .single-content code { background:rgba(255,255,255,.08); }
.single-content blockquote { margin:1.6em 0; padding:18px 24px; border-left:5px solid var(--main-color); background:linear-gradient(135deg,rgba(121,174,156,.08),rgba(82,132,111,.08)); border-radius:0 14px 14px 0; }
[data-theme="dark"] .single-content blockquote { background:rgba(255,255,255,.05); }

.post-tags { margin:42px 0 0; display:flex; flex-wrap:wrap; gap:8px 12px; }
.post-tags a { font-size:.7rem; letter-spacing:.5px; padding:6px 12px 6px; background:var(--bg-elevate,#f3f5f4); border-radius:20px; text-decoration:none; color:var(--text-secondary); transition:.25s; }
.post-tags a:hover { background:linear-gradient(135deg,var(--main-color),var(--dark-main-color)); color:#fff; }
[data-theme="dark"] .post-tags a { background:#222; }

/* 文章导航样式 - 简化版 */
.post-navigation {
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid #eee;
}

.nav-links {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.nav-prev,
.nav-next {
  flex: 1;
}

.nav-prev a,
.nav-next a {
  display: block;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  color: #666;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.nav-prev a:hover,
.nav-next a:hover {
  background: var(--main-color);
  color: white;
  border-color: var(--main-color);
  transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-links {
    flex-direction: column;
    gap: 12px;
  }
  
  .nav-prev a,
  .nav-next a {
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* Comments */
#comments { margin:68px 0 0; }
#comments h3 { font-size:1.2rem; margin:0 0 20px; }
.comment-list { list-style:none; margin:0; padding:0; }
.comment-list li { margin:0 0 28px; display:flex; gap:14px; }
.comment-body { flex:1; background:var(--bg-elevate,#f6f8f7); padding:14px 18px 18px; border:1px solid var(--border-primary); border-radius:14px; position:relative; }
.comment-body:before { content:""; position:absolute; left:-10px; top:16px; border:6px solid transparent; border-right-color:var(--border-primary); }
.comment-body:after { content:""; position:absolute; left:-8px; top:16px; border:6px solid transparent; border-right-color:var(--bg-elevate,#f6f8f7); }
[data-theme="dark"] .comment-body { background:#222; }
.comment-meta { font-size:.7rem; color:var(--text-secondary); display:flex; gap:10px; flex-wrap:wrap; margin:0 0 8px; }
.comment-content p { margin:0 0 .9em; }
.comment-reply-link { font-size:.7rem; text-transform:uppercase; letter-spacing:.5px; color:var(--main-color); }
.comment-reply-link:hover { text-decoration:underline; }

#commentform { margin-top:30px; display:flex; flex-direction:column; gap:16px; }
#commentform input[type="text"], #commentform input[type="email"], #commentform input[type="url"], #commentform textarea { width:100%; border:1px solid var(--border-primary); background:var(--bg-primary); border-radius:10px; padding:10px 14px; font-size:.9rem; }
#commentform textarea { min-height:140px; resize:vertical; }
#commentform input:focus, #commentform textarea:focus { outline:2px solid var(--main-color); outline-offset:2px; }
#commentform input[type="submit"] { align-self:flex-start; background:linear-gradient(135deg,var(--main-color),var(--dark-main-color)); border:none; color:#fff; padding:10px 20px; font-size:.85rem; border-radius:10px; cursor:pointer; }
#commentform input[type="submit"]:hover { filter:brightness(1.08); }

@media (max-width:960px) {
  .single-header .single-title { font-size:1.9rem; }
  .single-meta { justify-content:flex-start; }
  .post-navigation { flex-direction:column; }
  .post-navigation a { text-align:left; }
}
