/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  color: #004499;
  text-decoration: underline;
}

/* 头部导航 */
header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0066cc;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  flex-wrap: nowrap;
}

nav a {
  color: #333;
  font-weight: 500;
}

nav a:hover {
  color: #0066cc;
}

/* 移动端导航 */
@media (max-width: 768px) {
  nav ul {
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
  }

  nav li {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }

  nav a {
    display: block;
    padding: 0.5rem 0.3rem;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  nav {
    width: 100%;
  }
}

/* 主容器 */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* 标题 */
h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #222;
}

h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: #333;
  border-bottom: 2px solid #0066cc;
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: #444;
}

/* 卡片布局 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #0066cc;
}

.card-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

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

/* 内容区块 */
.section {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 详情页 */
.detail-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.detail-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: #e9ecef;
  color: #495057;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

/* 页脚 */
footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
}

/* 响应式 */
@media (max-width: 768px) {
  main {
    margin: 1rem auto;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 1rem;
  }

  .detail-header {
    padding: 1rem;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .detail-content {
    padding: 1rem;
  }
}