/* 基础重置与变量 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Microsoft YaHei', sans-serif;
}

:root {
  --primary: #ff6b6b; /* 动漫风主色（红色系） */
  --secondary: #4ecdc4; /* 辅助色（青色系） */
  --dark: #2d3436; /* 深色文字 */
  --light: #f8f9fa; /* 浅色背景 */
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* 卡片阴影 */
  --transition: all 0.3s ease; /* 过渡动画 */
}

body {
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
}

/* 容器样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部导航 */
header {
  background-color: white;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo i {
  font-size: 28px;
}

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

.nav-link {
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* 搜索与筛选区 */
.filter-section {
  background-color: white;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--card-shadow);
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.search-btn {
  padding: 12px 20px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.search-btn:hover {
  background-color: #ff5252;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: white;
}

/* 卡片通用样式 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin: 30px 0;
}

.card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--dark);
}

.card-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-desc {
  font-size: 15px;
  color: #555;
  line-height: 1.5;
}

/* 首页轮播图 */
.banner {
  height: 400px;
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
  display: flex;
  align-items: center;
  padding: 0 50px;
}

.banner-text {
  color: white;
  max-width: 600px;
}

.banner-text h2 {
  font-size: 36px;
  margin-bottom: 15px;
}

.banner-text p {
  font-size: 18px;
  opacity: 0.9;
}

/* 滚动展示区 */
.scroll-section {
  margin: 40px 0;
}

.section-title {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  font-size: 28px;
}

/* 用户社区样式 */
.community-section {
  background-color: white;
  border-radius: 12px;
  padding: 30px;
  margin: 30px 0;
  box-shadow: var(--card-shadow);
}

.post-form {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.post-textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-height: 120px;
  resize: vertical;
  margin-bottom: 15px;
  font-family: inherit;
}

.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.comment {
  padding: 20px;
  border-bottom: 1px solid #eee;
  transition: var(--transition);
}

.comment:hover {
  background-color: #f9f9f9;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.comment-author {
  font-weight: 600;
}

.comment-time {
  font-size: 14px;
  color: #666;
}

.comment-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.comment-action {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666;
  cursor: pointer;
  transition: var(--transition);
}

.comment-action:hover {
  color: var(--primary);
}

/* 页脚 */
footer {
  background-color: var(--dark);
  color: white;
  padding: 40px 0;
  margin-top: 50px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
}

.footer-links {
  list-style: none;
  display: flex;
  gap: 20px;
  margin-top: 15px;
}

.footer-links a {
  color: #ddd;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-copyright {
  text-align: center;
  margin-top: 30px;
  font-size: 14px;
  color: #aaa;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-menu {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .banner {
    height: 250px;
  }

  .banner-text h2 {
    font-size: 24px;
  }

  .banner-text p {
    font-size: 16px;
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .search-box {
    flex-direction: column;
  }
}