/* =====================
   通用样式
===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: #fafafa;
  color: #000;
  line-height: 1.6;
  min-height: 100vh;
  animation: fadeIn 0.6s ease-in-out; /* 淡入动画 */
  padding-bottom: 40px;
}

/* 页面淡入动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
   顶部导航栏
===================== */
header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* 左侧头像+昵称+返回 */
.header-right {
  display: flex;
  align-items: center;
}

.back-btn {
  text-decoration: none;
  color: #000;
  font-size: 1rem;
  margin-right: 15px;
}

.back-btn:hover {
  opacity: 0.7;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
}

.profile-img {
  width: 32px;
  height: 32px;
  margin-right: 5px; /* 图标和文字的间距 */
  vertical-align: middle;
}

.project-img {
  width: 32px;
  height: 32px;
  margin-right: 5px; /* 图标和文字的间距 */
  vertical-align: middle; /* 和文字垂直居中 */
}

.blog-img {
  width: 32px;
  height: 32px;
  margin-right: 5px; /* 图标和文字的间距 */
  vertical-align: middle;
}

.knowledge-img {
  width: 32px;
  height: 32px;
  margin-right: 5px; /* 图标和文字的间距 */
  vertical-align: middle;
}

.nickname {
  font-size: 1rem;
  font-weight: 600;
}

/* 右侧导航栏 */

.navbar {
  display: flex;
  justify-content: flex-start;
}

.navbar ul {
  list-style: none;
  display: flex;
  justify-content: flex-start;
  padding-left: 0;
  margin: 0;
  /* text-align: left; */
}

.navbar ul li {
  margin-right: 20px;
}

.navbar ul li a {
  text-decoration: none;
  color: #000;
  font-weight: 500;
  font-size: 1rem;
  padding-bottom: 4px;
  transition: opacity 0.3s ease;
}

.navbar ul li a:hover {
  opacity: 0.6;
}

/* 当前页面高亮 */
.navbar ul li a.active {
  font-weight: 700;
  border-bottom: 2px solid #000; /* 下划线高亮 */
}

/* =====================
   主体内容
===================== */
main {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

section {
  margin-bottom: 50px;
}

section h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

/* 首页标题链接 */
section h2 a {
  text-decoration: none;
  color: #000;
  transition: opacity 0.3s ease;
}

section h2 a:hover {
  opacity: 0.6;
}

section p {
  font-size: 1rem;
  color: #444;
}

/* =====================
   博客卡片布局
===================== */
.blog-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.blog-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease;
}

/* .blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
} */

.blog-card h3 {
  font-size: 1.2rem;
  margin: 12px;
}

.blog-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0 12px 12px;
}

.blog-card:hover {
  transform: translateY(-5px);
}

/* =====================
   项目经历时间轴
===================== */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid #ddd;
}

.timeline-item {
  margin-bottom: 30px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: #000;
  border-radius: 50%;
}

.timeline-item h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.timeline-item p {
  color: #666;
  font-size: 0.95rem;
}

/* /* =====================
  知识分享
=====================  */
.knowledge-container {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.knowledge {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.3s ease;
}

.knowledge h3 {
  font-size: 1.2rem;
  margin: 12px;
}

.knowledge p {
  font-size: 0.9rem;
  color: #666;
  margin: 0 12px 12px;
}

.knowledge:hover {
  transform: translateY(-5px);
}

/* =====================
   响应式优化
===================== */
@media (max-width: 768px) {
  .navbar ul {
    flex-direction: column;
    align-items: flex-start;
  }
  .navbar ul li {
    margin: 10px 0;
  }
}
