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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

a { color: #3498db; text-decoration: none; transition: color 0.3s; }
a:hover { color: #2980b9; }

/* 导航栏 */
nav {
  background: #2c3e50;
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
}

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

nav a {
  display: block;
  padding: 1rem 0.8rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.3s, transform 0.2s;
  font-weight: 500;
}

nav a:hover {
  background: #34495e;
  transform: translateY(-2px);
}

/* 响应式 */
@media (max-width: 768px) {
  nav a {
    padding: 0.8rem 0.3rem;
    font-size: 0.85rem;
  }
}

/* 返回顶部按钮 */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #3498db;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 99;
}

#backToTop:hover {
  background: #2980b9;
  transform: translateY(-5px);
}

#backToTop.show {
  display: flex;
}

/* 卡片悬停效果 */
article {
  transition: transform 0.3s, box-shadow 0.3s;
}

article:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}
