/* ============================================================
   custom.css — 页面定制 CSS 代码草稿
   复刻 https://blog.palind-rome.top/ 的 SimpleMemory 风格
   个人信息：CarbonOxygen / 流火照耀十三州府
   ============================================================ */

/* ---------- 设计变量（浅色 / 暗色双主题） ---------- */
:root {
  --primary: #2c7be5;
  --primary-dark: #1a5fc4;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #333333;
  --text-light: #666666;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 24px rgba(44, 123, 229, 0.15);
  --radius: 12px;
  --nav-h: 56px;
}

[data-theme="dark"] {
  --primary: #4a9eff;
  --primary-dark: #2c7be5;
  --bg: #1e1e2d;
  --surface: #262638;
  --text: #e0e0e0;
  --text-light: #a0a0b0;
  --border: #3a3a4d;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 6px 24px rgba(74, 158, 255, 0.2);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* ---------- 阅读进度条 ---------- */
#reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
}
#reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.1s linear;
}

/* ---------- 粒子背景 canvas ---------- */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- 顶部导航 ---------- */
header#top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}
.blog-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.5px;
}
.nav-menu { display: flex; gap: 22px; }
.nav-menu a {
  color: var(--text-light);
  font-size: 14px;
  position: relative;
  padding: 4px 0;
}
.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}
.nav-menu a:hover::after { width: 100%; }
.nav-menu a:hover { color: var(--primary); }

/* ---------- 主布局 ---------- */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

/* ---------- 文章卡片列表 ---------- */
.post-list { display: flex; flex-direction: column; gap: 20px; }
.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.post-card.pinned { border-left: 3px solid var(--primary); }
.post-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.pin-tag { color: var(--primary); font-size: 14px; }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}
.post-excerpt { color: var(--text-light); font-size: 14px; }
.read-more { display: inline-block; margin-top: 10px; font-weight: 500; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.pager a, .pager span {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-light);
}
.pager a:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 侧边栏 ---------- */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.widget {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.widget-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  color: var(--text);
}
.profile { text-align: center; }
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 32px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.profile-name { font-size: 17px; font-weight: 600; color: var(--text); }
.profile-bio { font-size: 12px; color: var(--text-light); margin: 6px 0 14px; }
.profile-stats {
  display: flex;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.profile-stats strong { display: block; font-size: 18px; color: var(--primary); }
.profile-stats span { font-size: 11px; color: var(--text-light); }
.profile-social { margin: 14px 0; display: flex; gap: 12px; justify-content: center; }
.profile-social a {
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--bg);
  font-size: 13px;
  border: 1px solid var(--border);
}
.profile-social a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.profile-poem {
  font-size: 12px;
  color: var(--text-light);
  line-height: 2;
  font-style: italic;
}
.toc { list-style: none; font-size: 13px; color: var(--text-light); }
.toc li { padding: 4px 0; border-bottom: 1px dashed var(--border); }

/* ---------- 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.site-footer span { margin: 0 4px; }
.theme-switch a { cursor: pointer; }

/* ---------- 点击飘字动画 ---------- */
#click-words { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9998; }
.click-word {
  position: absolute;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  animation: floatUp 1s ease-out forwards;
  white-space: nowrap;
}
@keyframes floatUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.4); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .nav-menu { gap: 14px; font-size: 13px; }
  .blog-title { font-size: 16px; }
}
