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

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

a {
  color: #d32f2f;
  transition: color 0.3s ease;
}

a:hover {
  color: #b71c1c;
}

/* 头部样式 */
.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: #d32f2f;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.nav a {
  text-decoration: none;
  color: #333;
  padding: 0.5rem 1rem;
  white-space: nowrap;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.nav a:hover {
  color: #d32f2f;
  background: #f5f5f5;
}

/* 移动端单行导航 */
@media (max-width: 768px) {
  .header-inner {
    flex-wrap: nowrap;
  }

  .logo {
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .nav {
    gap: 0;
    justify-content: space-between;
    flex: 1;
    margin-left: 1rem;
  }

  .nav a {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 0.5rem 0.25rem;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

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

/* 卡片样式 */
article {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

  article {
    padding: 1rem;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: #d32f2f;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 99;
}

.back-to-top:hover {
  background: #b71c1c;
  transform: translateY(-4px);
}

.back-to-top.show {
  display: flex;
}
