/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: #f5f5f5;
  color: #333;
}

/* 导航栏样式 */
.navbar {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
}

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

.nav-menu li {
  margin-left: 1.5rem;
}

.nav-menu a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: #3498db;
}

/* 主内容区 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* 知识页面样式 */
.knowledge-header {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin-bottom: 30px;
}

.knowledge-header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.knowledge-header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.knowledge-categories {
  padding: 0 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.knowledge-categories h2 {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #333;
}

.category-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 12px 24px;
  margin: 0 10px;
  background: #f0f0f0;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-bottom: 10px;
}

.tab-button:hover {
  background: #e0e0e0;
}

.tab-button.active {
  background: #667eea;
  color: white;
}

.subcategories {
  text-align: center;
  margin: 20px 0 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.subcategories h3 {
  margin-bottom: 15px;
  color: #333;
  font-size: 1.3rem;
}

.subcategories h4 {
  display: inline-block;
  margin: 0 10px 10px 0;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
  width: 80px;
  text-align: left;
  vertical-align: top;
}

.subcategory-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.subcategory-group {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.subcategory-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.subcategory-btn {
  padding: 8px 16px;
  background: #e9ecef;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
  margin: 5px;
  display: inline-block;
}

.subcategory-btn:hover {
  background: #dee2e6;
}

.subcategory-btn.active {
  background: #667eea;
  color: white;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 20px;
}

.article-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.article-card h3 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 1.3rem;
}

.article-category {
  color: #666;
  font-size: 0.9rem;
  margin: 10px 0;
  padding: 5px 10px;
  background: #f8f9fa;
  display: inline-block;
  border-radius: 4px;
}

.article-summary {
  color: #555;
  line-height: 1.6;
  margin: 15px 0;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  color: #888;
  font-size: 0.9rem;
}

.read-more {
  display: inline-block;
  margin-top: 15px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.read-more:hover {
  text-decoration: underline;
}

.article-filters {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin: 20px auto;
  max-width: 1200px;
}

.article-filters h2 {
  margin-top: 0;
  margin-bottom: 15px;
  text-align: center;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.filter-btn {
  padding: 8px 16px;
  background: #e9ecef;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.filter-btn:hover {
  background: #dee2e6;
}

.filter-btn.active {
  background: #667eea;
  color: white;
}

.articles-section {
  margin-top: 30px;
}

.articles-section h2 {
  text-align: center;
  margin-bottom: 20px;
}

/* 页脚样式 */
.site-footer {
  background-color: #333;
  color: #fff;
  padding: 2rem 0;
  margin-top: 2rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.footer-links {
  list-style: none;
  margin-top: 1rem;
}

.footer-links li {
  display: inline-block;
  margin: 0 0.5rem;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
}

/* 按钮样式 */
.btn-primary {
  padding: 10px 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

.btn-primary:hover {
  background: #0069d9;
}

.btn-secondary {
  padding: 10px 20px;
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* 复选框样式 */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  margin-right: 15px;
  cursor: pointer;
  font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
  margin-right: 5px;
  transform: scale(1.2);
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-menu {
    margin-top: 1rem;
    flex-wrap: wrap;
  }
  
  .nav-menu li {
    margin: 0.5rem 1rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .knowledge-header h1 {
    font-size: 2rem;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
  
  .tab-button {
    margin: 5px;
    flex: 1 0 auto;
    text-align: center;
  }
  
  .subcategory-group {
    display: block;
    text-align: left;
  }
  
  .subcategories h4 {
    display: block;
    text-align: left;
    width: auto;
    margin: 15px 0 5px 0;
  }
  
  .subcategory-tabs {
    flex-direction: column;
  }
  
  .subcategory-btn {
    width: 100%;
  }
  
  .filter-controls {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
  }
}