/* === 《疑犯追踪》—— 强制左右布局 v3 === */
* {
  box-sizing: border-box;
}

body {
  background-color: rgba(0, 0, 0, 0.35) !important;
  color: #e0e0e0 !important;
  font-family: 'Courier New', Consolas, monospace !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 隐藏原头部 */
#header, #topbar_container, .banner_bar, .postDesc {
  display: none !important;
}

/* 主容器：居中 */
#main {
  max-width: 1300px !important;
  margin: 0 auto !important;
  padding: 10px !important;
  position: relative;
}

/* 强制侧边栏浮动到左侧 */
#sideBar {
  float: left !important;
  width: 240px !important;
  margin-right: 20px !important;
  background-color: rgba(10, 10, 10, 0.52) !important;
  border: 1px solid #003300 !important;
  border-radius: 4px !important;
  padding: 12px !important;
  min-height: 200px !important;
  z-index: 10 !important;
}

/* 主内容区：右侧，自动填充剩余空间 */
#mainContent {
  overflow: hidden; /* 关键！防止浮动元素溢出 */
  background-color: rgba(15, 15, 15, 0.1) !important;
  border: 1px solid #222 !important;
  border-radius: 4px !important;
  padding: 20px !important;
}

/* 确保主内容区不被浮动影响 */
#mainContent::after {
  content: "";
  display: table;
  clear: both;
}

/* === 让侧边栏可滚动 === */
#sideBar {
  /* 固定宽度（根据你的布局） */
  width: 240px !important;
  
  /* 限制高度：从顶部到视窗底部留空 */
  max-height: calc(150vh) !important; /* 80px = 页首高度 + 间距 */
  
  /* 启用垂直滚动 */
  overflow-y: auto !important;
  overflow-x: hidden !important;
  
  /* 保持原有样式 */
  background-color: rgba(10, 10, 10, 0.92) !important;
  border: 1px solid #003300 !important;
  border-radius: 4px !important;
  padding: 12px !important;
  float: left !important;
  margin-right: 20px !important;
}

/* 美化滚动条（可选） */
#sideBar::-webkit-scrollbar {
  width: 8px;
}
#sideBar::-webkit-scrollbar-track {
  background: #050505;
}
#sideBar::-webkit-scrollbar-thumb {
  background: #004d00;
  border-radius: 4px;
}
#sideBar::-webkit-scrollbar-thumb:hover {
  background: #00aa00;
}

/* 文章标题 */
.postTitle a,
#cb_post_title_url,
#blogTitle h1 {
  color: rgba(0, 255, 0, 0.8); !important;
  text-shadow: 0 0 4px rgba(0, 255, 0, 0.5) !important;
}

/* 链接 */
a {
  color: #4dff4d !important;
  text-decoration: underline !important;
}
a:hover {
  color: #00ff00 !important;
}

/* 代码块 */
pre, code {
  background-color: rgba(0, 26, 0, 0.7) !important;
  color: #00ff00 !important;
  border: 1px solid #003300 !important;
  border-radius: 3px !important;
  padding: 6px !important;
  font-family: 'Courier New', monospace !important;
  overflow-x: auto;
}

img::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 255, 0, 0.1) 1px,
    rgba(0, 255, 0, 0.1) 2px
  );
  pointer-events: none;
  z-index: -1;
}

img {
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #050505;
}
::-webkit-scrollbar-thumb {
  background: #004d00;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00aa00;
}