* {
  margin:0; padding:0; box-sizing:border-box;
}
:root {
  --bg: #fff;
  --text: #333;
  --link: #3498db;
  --link-hover: #2980b9;
  --muted: #666;
  --border: #eaeaea;
  --code: #f8f9fa;
  --card-bg: #fff;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --header-bg: #f8f9fa;
}
.dark {
  --bg: #1a1a1a;
  --text: #e0e0e0;
  --link: #64b5f6;
  --link-hover: #42a5f5;
  --muted: #aaa;
  --border: #333;
  --code: #2d2d2d;
  --card-bg: #252525;
  --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
  --header-bg: #2d2d2d;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  line-height: 1.7;
  padding: 20px;
  transition: all 0.3s ease;
}

/* 题头图样式 */
.header-image {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 30px auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  position: relative;
}

.header-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.dark .header-image {
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

/* 题头图左侧头像区域 */
.header-avatar-overlay {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
}

.header-avatar-overlay .home-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-align: center;
  pointer-events: auto;
}

.header-avatar-overlay .avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--link);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  margin-bottom: 12px;
}

.header-avatar-overlay h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.header-avatar-overlay p {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 0 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}
/* 传统主页头部样式 */
.content .home-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: var(--header-bg);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}

/* 传统头像样式 */
.content .home-header .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.content .home-header .avatar:hover {
  transform: scale(1.05);
}

.content .home-header h1 {
  margin-top: 16px;
  font-size: 32px;
  font-weight: 700;
}

.content .home-header p {
  color: var(--muted);
  font-size: 18px;
  margin-top: 8px;
}
/* 主页布局 - 隐藏侧边栏，使用新布局 */

.home-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-top: 30px;
}

.home-content {
  flex: 1;
  min-width: 0;
}

/* 左侧栏：个人信息区域 + 目录侧边栏（上下排列） */
.home-left-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 280px;
  flex-shrink: 0;
}

.home-left-column .home-header {
  position: sticky;
  top: 30px;
  text-align: center;
  padding: 30px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.home-left-column .home-header .avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  margin: 0 auto 16px;
}

.home-left-column .home-header .avatar:hover {
  transform: scale(1.05);
}

.home-left-column .home-header h1 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

.home-left-column .home-header p {
  color: #666;
  font-size: 14px;
  margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .home-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .home-left-column {
    width: 100%;
    order: 2;
  }
  
  .home-content {
    order: 1;
  }
  
  .home-left-column .home-header {
    position: static;
    margin-bottom: 0;
  }
}

/* 非主页布局 */
.main {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.sidebar {
  width: 280px;
  flex-shrink: 0;
}
.toc {
  position: sticky;
  top: 30px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}
.toc strong {
  display: block;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.toc-item-1 {
  display: block;
  margin: 8px 0;
  font-weight: 500;
  color: var(--link);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.toc-item-1:hover {
  background: rgba(52, 152, 219, 0.1);
  color: var(--link-hover);
}
.toc-item-2 {
  display: block;
  margin: 6px 0 6px 20px;
  font-size: 14px;
  color: var(--link);
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.toc-item-2:hover {
  background: rgba(52, 152, 219, 0.1);
  color: var(--link-hover);
}
.toc-item-3 {
  display: block;
  margin: 4px 0 4px 40px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.toc-item-3:hover {
  color: var(--link);
}
.content {
  flex: 1;
  min-width: 0;
}
.post-item {
  margin-bottom: 20px;
  padding: 10px 24px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
}
.post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.post-date {
  color: var(--muted);
  font-size: 14px;
  display: block;
  margin-bottom: -2px;
  line-height: 1.2;
}
.post-title {
  font-size: 18px;
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.post-title a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.post-title a:hover {
  color: var(--link);
}

.nav-buttons {
  margin: 30px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-button {
  padding: 8px 16px;
  background: var(--link);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
}

.nav-button:hover {
  background: var(--link-hover);
  transform: translateY(-1px);
}

.pagination {
  margin-top: 40px;
  display: flex;
  gap: 12px;
  justify-content: center;
}
.pagination a {
  padding: 8px 16px;
  background: var(--link);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}
.pagination a:hover {
  background: var(--link-hover);
  transform: translateY(-1px);
}
pre {
  background: var(--code);
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
code {
  background: var(--code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
blockquote {
  border-left: 4px solid var(--link);
  padding-left: 1.5em;
  color: var(--muted);
  margin: 1.5em 0;
  font-style: italic;
}
.floating-nav-container {
  position: fixed;
  right: 30px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
  .floating-nav-container {
    right: 15px;
    bottom: 100px;
  }
  
  .floating-nav-button {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 60px;
  }
  
  #backToTop, #darkToggle {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .home-layout {
    flex-direction: column;
  }
  
  .home-left-column {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .home-content {
    width: 100%;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .main {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  .content {
    width: 100%;
  }
  
  .header-img {
    height: 150px;
  }
}

.floating-nav-button {
  padding: 10px 16px;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  min-width: 80px;
}

.floating-nav-button:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#backToTop {
  padding: 10px 16px;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#darkToggle {
  padding: 10px 16px;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
#backToTop:hover, #darkToggle:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
#backToTop { 
  bottom: 30px; 
  display: none;
}
#darkToggle { 
  bottom: 90px;
}
/* 浮动导航按钮样式 */
#prevPost, #backToHome, #nextPost {
  position: fixed;
  right: 30px;
  padding: 10px 16px;
  background: var(--link);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 99;
  transition: all 0.3s ease;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: block;
}
#prevPost:hover, #backToHome:hover, #nextPost:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
#prevPost {
  bottom: 150px;
}
#backToHome {
  bottom: 120px;
}
#nextPost {
  bottom: 90px;
}
.comment-section {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 1px solid var(--border);
}
/* 文章内容样式 */
.content h1 {
  font-size: 28px;
  margin: 1.5em 0 1em;
  font-weight: 700;
  color: var(--text);
}
.content h2 {
  font-size: 24px;
  margin: 1.3em 0 0.8em;
  font-weight: 600;
  color: var(--text);
}
.content h3 {
  font-size: 20px;
  margin: 1.2em 0 0.6em;
  font-weight: 600;
  color: var(--text);
}
.content p {
  margin-bottom: 1em;
  line-height: 1.8;
}
.content ul, .content ol {
  margin: 1em 0;
  padding-left: 2em;
}
.content li {
  margin-bottom: 0.5em;
}
.content a {
  color: var(--link);
  text-decoration: none;
}



/* 目录样式 */
.home-left-column .sidebar {
  width: 100%;
}

.home-left-column .toc {
  position: sticky;
  top: 30px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.home-left-column .toc strong {
  display: block;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.home-left-column .toc-item-1 {
  display: block;
  margin: 8px 0;
  font-weight: 500;
  color: #3498db;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.home-left-column .toc-item-1:hover {
  background: rgba(52, 152, 219, 0.1);
  color: #2980b9;
}

.home-left-column .toc-item-2 {
  display: block;
  margin: 6px 0 6px 20px;
  font-size: 14px;
  color: #3498db;
  text-decoration: none;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.home-left-column .toc-item-2:hover {
  background: rgba(52, 152, 219, 0.1);
  color: #2980b9;
}

.home-left-column .toc-item-3 {
  display: block;
  margin: 4px 0 4px 40px;
  font-size: 13px;
  color: #666;
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.home-left-column .toc-item-3:hover {
  color: #3498db;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .home-left-column .toc {
    position: static;
    margin-bottom: 0;
  }
}
.content a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
/* 标签页样式 */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}
.tag-item {
  flex-shrink: 0;
}
.tag-link {
  display: inline-block;
  padding: 8px 16px;
  background: var(--card-bg);
  color: var(--link);
  text-decoration: none;
  border-radius: 20px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--card-shadow);
}
.tag-link:hover {
  background: var(--link);
  color: #fff;
  transform: translateY(-1px);
}
.tag-count {
  font-size: 12px;
  opacity: 0.8;
  margin-left: 4px;
}
.tags-list {
  margin-top: 40px;
}
.tag-section {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.tag-section h2 {
  margin-top: 0;
  font-size: 24px;
  color: var(--link);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.tag-posts {
  list-style: none;
  padding: 0;
}
.tag-posts li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tag-posts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.tag-posts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.tag-posts a:hover {
  color: var(--link);
}
.tag-posts .post-date {
  color: var(--muted);
  font-size: 14px;
}

/* 文章标签显示 */
.post-tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-tag {
  padding: 4px 12px;
  background: rgba(52, 152, 219, 0.1);
  color: var(--link);
  font-size: 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.post-tag:hover {
  background: var(--link);
  color: #fff;
}

/* 相关文章推荐 */
.related-posts {
  margin-top: 3em;
  padding: 24px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}
.related-posts h3 {
  margin-top: 0;
  font-size: 20px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 20px;
}
.related-posts ul {
  list-style: none;
  padding: 0;
}
.related-posts li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.related-posts li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.related-posts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.related-posts a:hover {
  color: var(--link);
}
.related-posts .post-date {
  color: var(--muted);
  font-size: 14px;
}

/* 搜索结果样式 */
.search-result-item {
  padding: 12px;
  background: var(--card-bg);
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}
.search-result-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.search-result-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.search-result-item a:hover {
  color: var(--link);
}
.search-result-item small {
  color: var(--muted);
  margin-left: 8px;
}

/* 目录活动状态 */
.toc a.active {
  background: var(--link);
  color: #fff !important;
  font-weight: 600;
}

/* 归档页面样式 */
.archive-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.archive-list li {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.archive-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.archive-date {
  color: var(--muted);
  font-size: 14px;
  margin-right: 16px;
  min-width: 60px;
}
.archive-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  flex: 1;
}
.archive-list a:hover {
  color: var(--link);
}

/* 页脚样式 */
.footer {
  max-width: 1200px;
  margin: 40px auto 20px;
  padding: 20px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.footer a {
  color: var(--link);
  text-decoration: none;
}
.footer a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

@media (max-width:768px) {
  body {
    padding: 15px;
  }
  .main { 
    flex-direction: column;
    gap: 20px;
  }
  .sidebar { 
    width: 100%;
  }
  .toc { 
    position: static;
    margin-bottom: 20px;
  }
  .home-header {
    padding: 30px 15px;
  }
  .post-item {
    padding: 20px;
  }
  #backToTop, #darkToggle {
    right: 20px;
    padding: 8px 12px;
  }
  #backToTop { 
    bottom: 70px;
  }
  #darkToggle { 
    bottom: 20px;
  }
  .tags-cloud {
    gap: 8px;
  }
  .tag-link {
    padding: 6px 12px;
    font-size: 14px;
  }
  .tag-section {
    padding: 20px;
  }
}