/* ============================================================
   孙慧林的项目笔记 · 全站样式表
   ============================================================ */

:root {
  --primary: #4f6ef7;
  --primary-dark: #3b5bdb;
  --primary-soft: #eef2ff;
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #2b2f36;
  --muted: #6b7280;
  --border: #e5e8ef;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(30, 40, 90, 0.06);
  --shadow-hover: 0 10px 28px rgba(30, 40, 90, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.75;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6a8bff, #4f6ef7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(79, 110, 247, 0.35);
}

.site-nav { display: flex; gap: 6px; }

.site-nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover { color: var(--primary); background: var(--primary-soft); }

.site-nav a.active { color: var(--primary); font-weight: 600; }

.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

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

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}

.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 88px 0 72px;
  background: linear-gradient(180deg, #edf1ff 0%, var(--bg) 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(106, 139, 255, 0.16), transparent 65%);
  pointer-events: none;
}

.hero::before { top: -220px; right: -140px; }
.hero::after { bottom: -260px; left: -160px; }

.hero-kicker {
  letter-spacing: 4px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 14px;
}

.hero h1 { font-size: 44px; letter-spacing: 2px; }

.hero-sub {
  max-width: 560px;
  margin: 18px auto 30px;
  color: var(--muted);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 48px;
}

.hero-stats li {
  padding: 0 34px;
  border-right: 1px solid var(--border);
}

.hero-stats li:last-child { border-right: none; }

.hero-stats strong {
  display: block;
  font-size: 26px;
  color: var(--text);
}

.hero-stats span { font-size: 13.5px; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 11px 26px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #6a8bff, #4f6ef7);
  color: #fff;
  box-shadow: 0 6px 16px rgba(79, 110, 247, 0.35);
}

.btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(79, 110, 247, 0.45);
}

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 通用区块 ---------- */
.section { padding: 64px 0 8px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 26px;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
}

.section-head h2::before {
  content: "";
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, #6a8bff, #4f6ef7);
}

.more-link { font-size: 14px; }

/* ---------- 卡片 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card h3 { font-size: 17.5px; line-height: 1.5; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); }

.card-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.card-excerpt {
  color: var(--muted);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  background: var(--primary-soft);
  color: var(--primary);
}

.tag.t-python { background: #e7f3ff; color: #1c7ed6; }
.tag.t-git    { background: #fff4e6; color: #e8590c; }
.tag.t-css    { background: #fdeef6; color: #d6336c; }
.tag.t-db     { background: #f3ecfe; color: #7048e8; }
.tag.t-linux  { background: #e9ecef; color: #495057; }
.tag.t-tool   { background: #e6fcf5; color: #0ca678; }

/* ---------- 项目"截图"占位图（纯 CSS 绘制） ---------- */
.project-card { padding: 0; overflow: hidden; }

.shot { height: 180px; position: relative; }

.shot.g1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.shot.g2 { background: linear-gradient(135deg, #0ba360, #3cba92); }
.shot.g3 { background: linear-gradient(135deg, #f2994a, #f2c94c); }
.shot.g4 { background: linear-gradient(135deg, #5f72bd, #9b23ea); }
.shot.g5 { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.shot.g6 { background: linear-gradient(135deg, #ec4463, #f2607c); }

.shot .win-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 30px;
  background: rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
}

.win-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.shot-body {
  position: absolute;
  inset: 46px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shot-line {
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.shot-line.w1 { width: 55%; }
.shot-line.w2 { width: 80%; }
.shot-line.w3 { width: 68%; }
.shot-line.w4 { width: 40%; }

.shot-btn {
  width: 92px;
  height: 26px;
  margin-top: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

.shot-name {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
  flex: 1;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 18px;
  font-size: 14px;
}

/* ---------- 学习心得时间线 ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 10px 0 0 6px;
  padding-left: 30px;
  border-left: 2px solid var(--border);
}

.post { position: relative; padding-bottom: 40px; }

.post::before {
  content: "";
  position: absolute;
  left: -43px;
  top: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--primary);
}

.post-date { font-size: 13px; color: var(--muted); }
.post h3 { font-size: 19px; margin: 4px 0 10px; }
.post p { color: var(--muted); max-width: 660px; margin-bottom: 10px; }
.post .read-more { font-size: 14px; }

/* ---------- 内页顶部标题区 ---------- */
.page-hero {
  text-align: center;
  padding: 56px 0 40px;
  background: linear-gradient(180deg, #edf1ff, var(--bg));
}

.page-hero h1 { font-size: 32px; letter-spacing: 1px; }
.page-hero p { color: var(--muted); margin-top: 10px; }

.section.first { padding-top: 40px; }

/* ---------- 关于页 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
  align-items: start;
}

.about-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  margin-bottom: 12px;
}

.about-card p { color: var(--muted); font-size: 15px; margin-bottom: 10px; }

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 15px;
}

.contact-list .ico { display: inline-block; width: 30px; }

.notice {
  margin-top: 22px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: #fff9ec;
  border: 1px solid #ffe3a3;
  font-size: 14.5px;
  color: #8a6d1f;
}

.notice strong { color: #8a6d1f; }

/* ---------- 页脚（备案号位于底部居中） ---------- */
.site-footer {
  margin-top: 80px;
  padding: 36px 0 40px;
  text-align: center;
  background: #1f2533;
  color: #c6ccd8;
  font-size: 14px;
}

.footer-inner p { margin: 6px 0; }

.footer-beian a { color: #9fb2d8; transition: color 0.2s; }
.footer-beian a:hover { color: #ffffff; }

/* ---------- 返回顶部 ---------- */
#backTop {
  position: fixed;
  right: 26px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  font-size: 18px;
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s;
  z-index: 99;
}

#backTop.show { opacity: 1; visibility: visible; }
#backTop:hover { background: var(--primary); color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    padding: 10px 22px 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-open .site-nav { display: flex; }
  .site-nav a.active::after { display: none; }

  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 32px; }
  .hero-stats li { padding: 6px 20px; }

  .section { padding: 48px 0 4px; }
  .about-grid { grid-template-columns: 1fr; }
}
