/* styles.css */
html, body {
    margin: 0;
    padding: 0;
    font-size: 16px;
    background-color: #F7F8FC; /* 浅灰色背景 */
}

* {
    box-sizing: border-box;
}

nav ul {
    list-style-type: none;
}

nav a {
    text-decoration: none;
    color: black;
}

nav a:hover {
    color: blue;
}

.nav {
    list-style-type: none;
}

.nav li {
    display: block;
    margin-bottom: 1rem;
}

.container {
    display: flex;
    min-height: 100%;
    /* padding-bottom: 40px; */ /* 保证底部栏不会被内容遮挡 */
    justify-content: space-between;
}

.containernb {
    width: 100%;
    max-width: 840px; /* 按需调整宽度 */
    margin: 0 auto;
    padding: 20px;
}

.menu {
    background-color: #FFD700;
    width: 20%;
    padding: 1rem;
}

.content {
    background-color: #808080;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    float: left;
    display: flex;
    min-height: calc(100vh - 100px); /* 确保减去 header 和 footer 的高度 */
    padding: 1rem;
}

.forum-container {
    display: flex;
    flex-direction: column;
    width: 80%; /* 根据需求调整宽度 */
    max-width: 800px;
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 可选，添加阴影效果 */
}

.content img {
    margin-top: 20px; /* 或者根据需求设置适当的像素值，例如：margin-top: 20px; */
}

.title h1 {
    color: yellow;
    margin: 0;
}

.footer {
    background-color: #333;
    color: white;
    padding: 1rem;
    /* position: absolute; */
    text-align: center;
    bottom: 0;
    width: 100%;
}

body {
    position: relative;
}

.centered-form-overlay {
    position: absolute;
    top: 10%; /* 根据需求调整 */
    left: 50%;
    transform: translateX(-50%); /* 使其水平居中 */
    z-index: 1; /* 确保它在其他背景元素之上 */
}

.name-input-container {
    text-align: center;
    max-width: 400px;
    background-color: rgb(255 255 255 / 100%); /* 为了看清内容，可添加一个透明背景 */
    padding: 1rem;
    border-radius: 5px; /* 可选，美化样式 */
}

.footer-svg {
    cursor: pointer;
    fill: white;
    transition: fill 0.3s ease-in-out;
}

.footer-svg:hover {
    fill: lightblue;
}
  #postForm {
      margin-bottom: 20px;
  }

  #postContent {
      width: 100%;
      height: 100px;
      margin-bottom: 10px;
  }

  #posts {
      border: 1px solid #ccc;
      padding: 10px;
  }

  .post {
      margin-bottom: 10px;
      border-bottom: 1px solid #ccc;
      padding-bottom: 10px;
  }

  .post-content {
      white-space: pre-wrap; /* 或者 white-space: pre-line; */
      margin-bottom: 5px;
      word-break: break-all; /* 或者使用 word-wrap: break-word; （在较旧的浏览器中使用）*/
      max-width: 500px; /* 根据需求设置最大宽度 */
      overflow-wrap: break-word; /* 确保长单词也能换行 */
  }
  }

  .reply-content {
      margin-left: 20px;
      border-left: 1px solid #ccc;
      padding-left: 10px;
  }

.body-container {
    flex-direction: column;
    min-height: 100vh;
}

.container {
    overflow-y: auto; /* 添加滚动条，防止内容溢出 */
}

.footer {
    margin-top: auto; /* 保持在底部 */
    /* 其他底部栏样式... */
}

/* 论坛帖子输入框及按钮样式 */
#postForm {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 800px; /* 可根据实际需求调整 */
    margin: 0 auto;
}

#postContent {
    width: 100%;
    height: 150px; /* 根据需要自定义高度 */
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    font-size: 16px;
    resize: vertical;
}

#postForm button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.post-time {
    float: right;
    color: #999;
    font-size: 0.8em;
    margin-top: 5px;
    padding-right: 10px;
    border-right: 1px solid #ddd;
}

/* 可选：当按钮被点击时的样式 */
#postForm button:active {
    background-color: #004085;
    opacity: 0.9;
}

/* 输入姓名部分样式 */
.name-input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 125px;
    margin-right: 150px;
    width: 100%;
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgb(172 172 172 / 10%);
    max-width: 300px; /* 根据需求设置一个较小的宽度 */
    max-height: 200px;
    float: right;
}


.name-input-container label {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #333;
}

.name-input-container input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    outline: none;
    font-size: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.name-input-container input[type="text"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.name-input-container button {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    
}

.name-input-container button:hover {
    background-color: #0056b3;
}

.name-input-container button:active {
    background-color: #004085;
    opacity: 0.9;
}

/* CSS样式添加到您的样式表中 */
.reply-content {
    background-color: #f0f0f0; /* 更改颜色以符合您所需的灰色 */
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 5px;
    font-size: 0.8em;
    line-height: 1.5;
}

/* 如果需要引用线 */
.reply-content::before {
    content: "";
    display: block;
    border-left: 5px solid #ccc;
    height: 100%;
    pointer-events: none;
}

.reply-button {
    background-color: #4CAF50; /* 绿色背景色 */
    border: none;
    color: white; /* 文字颜色为白色 */
    padding: 8px 16px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin-top: 5px;
    cursor: pointer;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 添加阴影效果 */
}

.reply-button:hover {
    background-color: #45a049; /* 鼠标悬停时背景颜色加深 */
    opacity: 0.9;
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 200px;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 20px;
  border-radius: 4px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  text-align: center;
  opacity: 0;
}

.btn-confirm {
  background-color: #4CAF50;
  border: none;
  color: white;
  padding: 8px 16px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 14px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 4px;
}

.btn-confirm:hover {
  background-color: #45a049;
  opacity: 0.9;
}

/* 定义显示动画关键帧 */
@keyframes ScaleDownAndfadeIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0); /* 这里设置缩小后的起始尺寸 */
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5); /* 这里设置正常尺寸 */
  }
}

/* 显示并执行缩放与淡入动画 */
#modal.animate-modal {
  animation:
    ScaleDownAndfadeIn 0.4s cubic-bezier(0, 0, 0, 1.16);
  animation-fill-mode: forwards;
}

@keyframes fadeOutAndScaleDown {
  0% {
    opacity: 1;
    transform:  translate(-50%, -50%) scale(1.5);
  }
  100% {
    opacity: 0;
    transform:  translate(-50%, -50%) scale(0);
  }
}

#modal.animate-modal-out {
  animation:
    fadeOutAndScaleDown 0.3s cubic-bezier(0, 0, 1, -0.36);
  animation-fill-mode: forwards;
}

/* 右上角定位的刷新按钮样式 */
.refresh-button {
  position: fixed;
  bottom: 20px; /* 修改为距离底部20像素 */
  right: 20px; /* 保持距离右侧20像素 */
  background-color: #4CAF50; /* 自定义背景颜色 */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 20px;
  outline: none;
  transition: background-color 0.3s ease;

  /* 图标样式 */
  .fas {
    margin-right: 5px;
  }
  
  &:hover {
    background-color: #45a049; /* 鼠标悬停时的背景颜色 */
  }
}

img {
  max-width: 735px; /* 指定最大宽度 */
  max-height: 500px; /* 指定最大高度 */
  height: auto; /* 保持图片的自然高度与宽度比 */
  width: auto; /* 同上，保持比例 */
  display: block; /* 使图片独占一行，并消除可能的底部空白 */
  margin: 0 auto; /* 居中显示（如果需要的话） */
}

