/* ==========================
   页面基础结构
========================== */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  font-family: "Barlow", "PingFang SC", sans-serif;
  line-height: 1.8;
  background: #f9f9f9;
  display: flex;
}

sidebar-nav,
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background-color: #f0f0f0;
  border-right: 1px solid #ccc;
  padding-top: 20px;
}

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

.sidebar li {
  margin-bottom: 20px;
  text-align: center;
}

.sidebar a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

.sidebar a:hover {
  color: #0078d4;
}
.info-box {
  margin-top: 70px;
  padding: 14px 14px;
  border-radius: 8px;
  font-size: 12px;
  color: rgb(80, 80, 80);
  line-height: 1.6;
  transition: background 0.3s ease;
}


.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow-y: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

h1 {
  text-align: center;
}

/* ==========================
   树布局
========================== */
.posts {
  column-count: 2;               /* 可根据屏幕宽度调整 */
  column-gap: 20px;
  margin: 0px 10px 0px 10px;
  max-width: 1200px;             /* 可根据需要设定最大宽度 */
}

.post-tree {
  display: block;                /* 避免 flex 布局干扰列流 */
  break-inside: avoid;          /* 防止内容被拆断 */
  background-color: #fafafa;
  border: 1px solid #a0b3d6;
  border-radius: 6px;
  box-sizing: border-box;
  margin-bottom: 20px;
  padding: 12px; 
  overflow:hidden;
}

.post-tree {
  position: relative;
}
.connection-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}



.post-wrapper-vertical {
  min-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
.post-children-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  overflow-x: auto;
  overflow-y: auto;
  position: relative;
  scroll-snap-type: x mandatory;
}

.post-wrapper-vertical > .post {
  scroll-snap-align: start;
}


/* ==========================
   帖子内容样式
========================== */
.post {
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  font-weight: bold;
  color: black;
  background: #ebeaea;
}

.post-meta {
  font-weight: bold;
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.post-user {
  font-weight: bold;
  margin-right: 8px;
}

.post-time {
  font-size: 0.8em;
  color: #999;
  margin-left: 10px;
}

.post-content,
.content {
  margin: 5px 0 10px 0;
  font-weight: normal;
  color: #333;
  word-break: break-word;
  white-space: pre-wrap;
  max-height: 200px;
  overflow: hidden;
  position: relative;
  font-size: 14px;
}

.post-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
}
.linki {
  color:#666;
  text-decoration: underline;
  display: inline-block;
  max-width: 100%;        
  word-break: break-all;  
  font-size: 12px;
}

.linki:hover {
  color: #007bff;
}

.post-tags a {
  color: #007bff;
  text-decoration: none; /* 覆盖默认样式，去掉下划线 */
}

.post-tags a:hover {
  text-decoration: underline; /* 悬停时再显示 */
}



/* ==========================
   按钮样式
========================== */
button {
  padding: 5px 5px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8em;
  transition: background-color 0.3s;
  background-color: #007bff;
  color: white;
}

button:hover {
  background-color: #0056b3;
}


#modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y:auto;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
}

#modal-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 400px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#modal-form .form-group {
  margin-bottom: 12px;
}

#modal-form input,
#modal-form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  box-sizing: border-box;
  border: 0.1px solid #007bff;
  border-radius: 4px;
}

#modal-form label{
  font-weight: bold;
}
/* ==========================
   聚焦模式样式
========================== */
.focus-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  overflow: auto; /* ✅ 防止外部滚动条干扰 */
  padding: 20px 10% 20px 10%;     /* ✅ 给内容留出边距 */
  box-sizing: border-box;
}

.focus-overlay .post-wrapper-vertical{
  min-width: 38vw;
}

.focus-overlay .post-content{
  max-height: none;
}

.focus-close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}



/* ==========================
   表单提示消息
========================== */
.message {
  margin-top: 20px;
  font-weight: bold;
}


.comment-modal {
  background: #fff;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border-radius: 6px;
}
.comment-modal textarea {
  width: 100%;
  resize: none;
}
.comment-modal button {
  margin-top: 8px;
}

textarea{
    font-family: "Barlow", "PingFang SC", sans-serif;
    line-height: 1.8;
}

