/* 响应式布局优化 - 统一断点管理 */
@media (min-width: 1200px) {
  #main {
    width: 80%;
  }
}

@media (max-width: 768px) {
  #main, #sidebar {
    width: 100%;
  }
  
  #home {
    width: 94% !important;
    padding: 1.5rem 1.2rem !important;
  }
  
  .newsItem, .catListEssay {
    padding: 1rem 1.2rem !important;
  }
  
  body {
    background-image: 
      linear-gradient(rgba(245, 247, 249, 0.4), rgba(245, 247, 249, 0.6)),
      url('https://picsum.photos/id/180/1080/720'),
      linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
  }

  #cnblogs_post_body pre {
    padding: 1rem !important;
    font-size: 0.9em;
  }
}

/* 全局背景优化 - 固定背景图 */
body {
  background-color: #f5f7fa;
  background-image: 
    linear-gradient(rgba(245, 247, 249, 0.5), rgba(245, 247, 249, 0.7)),
    url('https://picsum.photos/id/1048/1920/1080');
  background-attachment: fixed;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  /* 渐进式加载优化 - 使用固定模糊图 */
  background-image: linear-gradient(rgba(245, 247, 249, 0.5), rgba(245, 247, 249, 0.7)),
    url('https://picsum.photos/id/1048/1920/1080?blur=20'),
    url('https://picsum.photos/id/1048/1920/1080');
}

/* 页面主体优化 - 提升质感（降低透明度） */
#home {
  width: 82% !important;
  margin: 2rem auto !important;
  padding: 1.8rem 2.5rem !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(248, 249, 250, 0.95)) !important;
  backdrop-filter: blur(8px); /* 毛玻璃效果增强 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 标题样式优化 - 增强层次感 */
#home h1, #home h2 {
  color: #2d2d2d;
  margin-bottom: 1.2rem !important;
  font-weight: 600;
  line-height: 1.45em;
  border-left: 4px solid #4a90e2;
  padding-left: 1rem;
  position: relative;
  transition: color 0.3s ease;
}

#home h1::after, #home h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 40px;
  height: 2px;
  background: #4a90e2;
  transition: width 0.3s ease;
}

#home h1:hover, #home h2:hover {
  color: #357abd;
}

#home h1:hover::after, #home h2:hover::after {
  width: 80px;
}

/* 代码块美化增强 - 极简清晰风格 */
#cnblogs_post_body pre {
  /* 纯净浅灰底色，突出代码本身 */
  background: #f8f9fa;
  color: #2d3748; /* 统一深灰文字色 */
  padding: 1.5rem 1.8rem !important;
  border-radius: 10px;
  font-family: "Fira Code", "Consolas", "Microsoft YaHei", monospace;
  font-size: 0.95em;
  line-height: 1.7; /* 宽松行高提升可读性 */
  overflow-x: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid #e9ecef;
  margin: 1.8rem 0 !important;
  position: relative;
  /* 代码行号样式（如果有） */
  counter-reset: line;
}

/* 极简语法高亮 - 仅保留必要区分 */
#cnblogs_post_body pre .keyword { 
  color: #2d3748; 
  font-weight: 600; /* 关键词加粗代替变色 */
}
#cnblogs_post_body pre .string { 
  color: #4a5568; 
  font-style: italic; /* 字符串斜体代替变色 */
}
#cnblogs_post_body pre .comment { 
  color: #718096; /* 注释浅灰色 */
}
#cnblogs_post_body pre .number,
#cnblogs_post_body pre .function,
#cnblogs_post_body pre .operator { 
  color: #2d3748; /* 统一颜色 */
}

/* 代码块头部装饰 */
#cnblogs_post_body pre::before {
  content: "代码";
  position: absolute;
  top: 0;
  right: 1rem;
  font-size: 0.8em;
  color: #adb5bd;
  padding: 0.2rem 0.5rem;
}

/* 滚动条美化 */
#cnblogs_post_body pre::-webkit-scrollbar {
  height: 8px;
}
#cnblogs_post_body pre::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 4px;
}
#cnblogs_post_body pre::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 4px;
}
#cnblogs_post_body pre::-webkit-scrollbar-thumb:hover {
  background: #ced4da;
}

/* 行内代码样式统一 */
#cnblogs_post_body code {
  background: #f1f3f5;
  color: #2d3748;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  font-size: 0.9em;
  margin: 0 0.2rem;
  font-weight: 500;
}

/* 可选：添加代码行分隔线 */
#cnblogs_post_body pre code::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 1.5rem;
  margin-right: 1rem;
  text-align: right;
  color: #adb5bd;
}

/* 行内代码样式统一 */
#cnblogs_post_body code {
  background: #f1f3f5;
  color: #e53e3e;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Fira Code", monospace;
  font-size: 0.9em;
  margin: 0 0.2rem;
}

/* 侧边栏优化 - 增强交互感（降低透明度） */
.newsItem, .catListEssay {
  background: rgba(255, 255, 255, 0.83);
  backdrop-filter: blur(4px);
  margin: 1.5rem 0 !important;
  padding: 1.2rem 1.8rem !important;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.newsItem:hover, .catListEssay:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

/* 链接样式增强 - 优化动画 */
a {
  color: #4a90e2;
  text-decoration: none;
  transition: color 0.2s ease;
  position: relative;
}

a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: #357abd;
  transition: width 0.3s ease;
}

a:hover {
  color: #357abd;
}

a:hover::after {
  width: 100%;
}

/* 表格优化 - 增强可读性（降低透明度） */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  box-shadow: 0 1px 5px rgba(0,0,0,0.07);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 12px 15px;
  border: 1px solid #e9ecef;
  text-align: left;
}

th {
  background-color: rgba(248, 249, 250, 0.8);
  color: #2d2d2d;
  font-weight: 600;
}

tr:nth-child(even) td {
  background-color: rgba(248, 249, 250, 0.4);
}

/* 图片响应式优化 */
#cnblogs_post_body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin: 1rem 0;
}

/* 按钮/交互元素优化 */
.cnblogs-button {
  display: inline-block;
  padding: 6px 12px;
  background: #4a90e2;
  color: white !important;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: none;
}

.cnblogs-button:hover {
  background: #357abd;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}