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

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

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

a:hover {
  color: #3498db;
}

/* 导航样式 */
nav {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .logo {
  padding: 15px 20px;
  font-size: 22px;
  font-weight: bold;
  display: inline-block;
  letter-spacing: 1px;
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

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

nav a {
  display: block;
  padding: 15px 10px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.3s;
}

nav a:hover {
  background: rgba(52, 152, 219, 0.2);
  color: #fff;
}

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

header h1 {
  font-size: 28px;
  color: #2c3e50;
  margin: 20px 0;
  padding-bottom: 10px;
  border-bottom: 3px solid #3498db;
}

h1 {
  font-size: 28px;
  color: #2c3e50;
  margin: 20px 0;
}

h2 {
  font-size: 22px;
  color: #34495e;
  margin: 25px 0 15px;
  padding-left: 10px;
  border-left: 4px solid #3498db;
}

h3 {
  font-size: 18px;
  margin: 10px 0;
}

/* 区块样式 */
section {
  background: #fff;
  margin: 20px 0;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.intro {
  background: linear-gradient(135deg, #e8f4f8 0%, #f0f8ff 100%);
  border-left: 5px solid #3498db;
}

/* 卡片网格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.card h3 {
  margin-top: 0;
}

.card .meta {
  font-size: 14px;
  color: #7f8c8d;
  margin: 8px 0;
}

/* 列表样式 */
.list {
  list-style: none;
  padding: 0;
}

.list li {
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
}

.list li:last-child {
  border-bottom: none;
}

.list strong {
  color: #2c3e50;
  font-size: 16px;
}

/* 详情页样式 */
article .info p {
  margin: 10px 0;
  padding: 8px 0;
  border-bottom: 1px dashed #ecf0f1;
}

article .info strong {
  display: inline-block;
  width: 80px;
  color: #2c3e50;
}

article .highlight {
  background: #fff9e6;
  border-left: 4px solid #f39c12;
  padding: 15px 20px;
}

article .summary, article .review {
  line-height: 1.8;
}

article .related ul {
  list-style: none;
  padding: 0;
}

article .related li {
  padding: 12px 0;
  border-bottom: 1px solid #ecf0f1;
}

/* 列表页特殊样式 */
.all-list .item,
.rank-item,
.latest-item,
.topic-card {
  background: #fafafa;
  padding: 15px;
  margin: 15px 0;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  transition: background 0.3s;
}

.all-list .item:hover,
.rank-item:hover,
.latest-item:hover,
.topic-card:hover {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rank-item {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}

.rank-num {
  font-size: 24px;
  font-weight: bold;
  color: #3498db;
  min-width: 50px;
  text-align: center;
}

.rank-item .content {
  flex: 1;
}

.latest-item {
  display: flex;
  gap: 15px;
}

.latest-item .date {
  font-size: 16px;
  font-weight: bold;
  color: #95a5a6;
  min-width: 60px;
}

.latest-item .content {
  flex: 1;
}

.topic-group {
  margin: 30px 0;
}

.topic-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
}

.meta {
  font-size: 14px;
  color: #7f8c8d;
}

/* 响应式设计 */
@media (max-width: 768px) {
  nav ul {
    flex-wrap: nowrap;
    overflow: visible;
  }

  nav a {
    padding: 12px 5px;
    font-size: 14px;
  }

  nav .logo {
    font-size: 18px;
    padding: 12px 15px;
  }

  main {
    padding: 15px;
  }

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

  .topic-items {
    grid-template-columns: 1fr;
  }

  header h1, h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  section {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  nav a {
    padding: 10px 3px;
    font-size: 12px;
  }

  .rank-num {
    font-size: 18px;
    min-width: 40px;
  }
}
