/* ============================================
   郭俊生 · 个人静态站点 全局样式
   纯 CSS，无框架，系统字体，加载快
   ============================================ */

/* ---------- 基础重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* 全局平滑滚动 */
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  background-color: #f7f8fa;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ---------- 布局容器 ---------- */
.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
}

/* ---------- 顶部导航栏 ---------- */
.navbar {
  position: sticky; /* 滚动时置顶 */
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
  z-index: 100;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: #1a73e8;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 15px;
  color: #555;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover {
  color: #1a73e8;
}

/* 当前页面高亮 */
.nav-links a.active {
  color: #1a73e8;
  font-weight: 600;
  border-bottom-color: #1a73e8;
}

/* 汉堡按钮（移动端显示） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

/* 汉堡展开时的按钮动画 */
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 首屏 Hero ---------- */
.hero {
  padding: 90px 0 80px;
  text-align: center;
  background: linear-gradient(160deg, #eaf3ff 0%, #f7f8fa 70%);
}

/* 首屏个人形象照 */
.hero-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 26px;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(26, 115, 232, 0.18);
}

.hero h1 {
  font-size: 42px;
  letter-spacing: 2px;
  margin-bottom: 16px;
  color: #222;
}

.hero p {
  font-size: 18px;
  color: #666;
  margin-bottom: 36px;
  letter-spacing: 1px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 8px;
  font-size: 15px;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-outline {
  border: 1.5px solid #1a73e8;
  color: #1a73e8;
  background: transparent;
}

.btn-outline:hover {
  background: #1a73e8;
  color: #fff;
}

/* ---------- 通用板块 ---------- */
.section {
  padding: 70px 0;
}

.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 12px;
  color: #222;
}

.section-sub {
  text-align: center;
  color: #888;
  margin-bottom: 44px;
  font-size: 14px;
}

.section:nth-of-type(odd) {
  background: #fff;
}

/* ---------- 个人简介摘要 ---------- */
.about-brief {
  max-width: 820px;
  margin: 0 auto;
  color: #555;
  text-align: justify;
  font-size: 16.5px;
}

/* 简介多段落间距 */
.about-brief p {
  margin-bottom: 14px;
}

.about-brief p:last-child {
  margin-bottom: 0;
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* 项目 / 随笔卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  background: #eef1f5;
}

.card-body {
  padding: 22px;
}

.card-title {
  font-size: 18px;
  margin-bottom: 10px;
  color: #222;
}

.card-text {
  font-size: 14.5px;
  color: #666;
  margin-bottom: 14px;
}

/* 标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-size: 12.5px;
  color: #1a73e8;
  background: #eaf3ff;
  padding: 3px 12px;
  border-radius: 999px;
}

/* ---------- 展开详情区（works / blog 用） ---------- */
.card-detail {
  display: none; /* 默认收起，JS 切换 */
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #ddd;
  font-size: 14.5px;
  color: #555;
}

.card.open .card-detail {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.card-more {
  display: inline-block;
  font-size: 14px;
  color: #1a73e8;
  margin-top: 4px;
}

/* ---------- 随笔列表 ---------- */
.post {
  background: #fff;
  border-radius: 12px;
  padding: 26px 28px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 0.25s;
}

.post:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
}

.post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.post-title {
  font-size: 19px;
  color: #222;
}

.post-date {
  font-size: 13px;
  color: #999;
}

.post-summary {
  margin-top: 10px;
  color: #666;
  font-size: 14.5px;
}

.post-full {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
  color: #555;
  font-size: 15px;
}

.post.open .post-full {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ---------- 关于我页 ---------- */
.avatar-wrap {
  text-align: center;
  margin-bottom: 50px;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 4px solid #eaf3ff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.avatar-tip {
  font-size: 13px;
  color: #aaa;
}

.about-text {
  max-width: 820px;
  margin: 0 auto;
  color: #555;
  text-align: justify;
}

.about-text p {
  margin-bottom: 16px;
}

/* 教学案例 */
.case-box {
  background: #fff;
  border-left: 4px solid #1a73e8;
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.case-box h4 {
  margin-bottom: 8px;
  color: #222;
}

.case-box p {
  color: #666;
  font-size: 15px;
}

/* 技能标签 */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.skill {
  font-size: 14px;
  color: #444;
  background: #fff;
  border: 1px solid #e3e8ef;
  padding: 8px 20px;
  border-radius: 999px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
}

/* 时间线 */
.timeline {
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  padding-left: 28px;
}

/* 竖线 */
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #dce6f5;
}

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

/* 圆点 */
.timeline-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1a73e8;
  border: 3px solid #eaf3ff;
}

.timeline-item h4 {
  color: #222;
  margin-bottom: 4px;
}

.timeline-item p {
  color: #666;
  font-size: 14.5px;
}

/* ---------- 联系我页 ---------- */
.contact-info {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.contact-item {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-size: 17px;
}

.contact-item span {
  color: #888;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.contact-slogan {
  margin: 26px 0 8px;
  color: #555;
  text-align: center;
}

/* 静态留言展示 */
.msg-box {
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.msg-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.msg-name {
  font-weight: 600;
  color: #222;
}

.msg-date {
  font-size: 13px;
  color: #999;
}

.msg-text {
  color: #666;
  font-size: 15px;
}

/* ---------- 页脚 ---------- */
.footer {
  background: #22293a;
  color: #aab2c5;
  text-align: center;
  padding: 34px 0;
  font-size: 14px;
  line-height: 2;
}

.footer a {
  color: #aab2c5;
}

.footer a:hover {
  color: #fff;
}

/* ---------- 响应式：移动端 ---------- */
@media (max-width: 820px) {
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero {
    padding: 70px 0 60px;
  }

  /* 导航折叠为汉堡菜单 */
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: #fff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    max-height: 0; /* 默认收起 */
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open {
    max-height: 320px;
  }

  .nav-links a {
    display: block;
    padding: 14px 6%;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-links a.active {
    border-left-color: #1a73e8;
  }
}
