/* 全局重置 & 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft Yahei", Arial, sans-serif;
}

body {
  color: #333;
  background-color: #f8f9fa;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: #2c82ff;
  transition: color 0.3s;
}

a:hover {
  color: #1a68e0;
}

.container {
  width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部导航 */
.header {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: #2c82ff;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-menu a {
  font-size: 16px;
  color: #333;
}

.nav-menu a.active {
  color: #2c82ff;
  font-weight: 500;
}

/* 按钮通用样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn-primary {
  background-color: #2c82ff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #1a68e0;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #2c82ff;
  color: #2c82ff;
}

.btn-outline:hover {
  background-color: #f0f7ff;
}

/* 页脚样式 */
.footer {
  background-color: #333;
  color: #ccc;
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  text-align: center;
  font-size: 14px;
}

/* 首页Banner */
.banner {
  height: 400px;
  background: linear-gradient(135deg, #2c82ff 0%, #1a68e0 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 60px;
}

.banner h1 {
  font-size: 48px;
  margin-bottom: 16px;
}

.banner p {
  font-size: 18px;
  max-width: 800px;
}

/* 首页板块通用样式 */
.section {
  margin-bottom: 60px;
}

.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: #2c82ff;
  margin: 12px auto 0;
}

/* 首页新闻预览 */
.news-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.news-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 20px;
  transition: transform 0.3s;
}

.news-card:hover {
  transform: translateY(-5px);
}

.news-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.news-card .date {
  color: #999;
  font-size: 12px;
  margin-bottom: 12px;
}

.news-card .desc {
  color: #666;
  font-size: 14px;
}

/* 登录/注册页面样式 */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 40px 0;
}

.auth-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 40px;
  min-width: 400px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 32px;
  color: #333;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #2c82ff;
}

.auth-btn {
  width: 100%;
  padding: 12px;
  font-size: 16px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

/* 新闻列表页样式 */
.news-list {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 30px;
}

.news-item {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.news-item .meta {
  display: flex;
  gap: 20px;
  color: #999;
  font-size: 14px;
  margin-bottom: 12px;
}

.news-item .content {
  color: #666;
  line-height: 1.8;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #fff;
  cursor: pointer;
}

.pagination button.active {
  background-color: #2c82ff;
  color: #fff;
  border-color: #2c82ff;
}

/* 提示信息样式 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 4px;
  color: #fff;
  z-index: 9999;
  display: none;
}

.toast-success {
  background-color: #52c41a;
}

.toast-error {
  background-color: #f5222d;
}

/* 联系我们页面样式 */
.contact-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 30px;
  height: 100%;
}

.contact-wrapper {
  align-items: start;
}

/* 适配小屏PC，避免布局挤压 */
@media (max-width: 992px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
}

/* 发布帖子页面样式优化 */
#publish-form textarea {
  line-height: 1.6; /* 优化内容行高，提升可读性 */
}

#post-title {
  font-size: 16px; /* 标题输入框字号稍大，突出重点 */
}

/* 小屏适配：缩小表单内边距，避免挤压 */
@media (max-width: 768px) {
  .auth-card {
    padding: 30px 20px;
  }
}

