/* 完全重置样式，避免外部干扰 */
.forum-notice,
.forum-notice * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft Yahei", sans-serif;
  list-style: none;
  text-decoration: none;
  border: none;
  outline: none;
}

/* 通栏式公告容器（移除关闭按钮后优化布局） */
.forum-notice {
  width: 100%;
  height: 60px;
  background: #ffffff;
  border: 1px solid #fef2f2;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  padding: 0 20px;
  margin: 10px 0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.04);
}

/* 左侧红色竖条标识 */
.notice-tag {
  width: 4px;
  height: 30px;
  background: linear-gradient(180deg, #dc2626, #f87171);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 置顶标识 */
.notice-top {
  display: inline-block;
  background: #fef2f2;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid #fee2e2;
}

/* 日期显示 */
.notice-date {
  display: inline-block;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  flex-shrink: 0;
}

/* 公告内容容器（移除关闭按钮后占满剩余空间） */
.notice-content {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* 公告文本 */
.notice-text {
  white-space: nowrap;
  color: #374151;
  font-size: 15px;
  line-height: 60px;
  letter-spacing: 0.3px;
  animation: scrollNotice 22s linear infinite;
  position: absolute;
  left: 0;
  top: 0;
  transition: opacity 0.5s ease-in-out;
}

/* 滚动动画 */
@keyframes scrollNotice {
  0% {
    left: 100%;
    transform: translateX(0);
  }
  100% {
    left: 0;
    transform: translateX(-100%);
  }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .forum-notice {
    height: 50px;
    padding: 0 15px;
    gap: 10px;
  }
  .notice-text {
    font-size: 14px;
    line-height: 50px;
    animation-duration: 18s;
  }
  .notice-top {
    padding: 2px 6px;
    font-size: 11px;
  }
  .notice-date {
    padding: 1px 4px;
    font-size: 10px;
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .forum-notice {
    background: #1f2937;
    border-color: #374151;
  }
  .notice-top {
    background: #374151;
    color: #fca5a5;
    border-color: #4b5563;
  }
  .notice-date {
    background: #374151;
    color: #d1d5db;
    border-color: #4b5563;
  }
  .notice-text {
    color: #f9fafb;
  }
}