/* ============================================================
   Toby 的家 — 全局样式（暖色系 / 居家主题 / 浅色）
   ============================================================ */

:root {
  --bg: #faf6f0;
  --bg-warm: #f3ebe0;
  --surface: #fffdfa;
  --surface-2: #fbf4ec;
  --primary: #c97b5a;
  --primary-dark: #a85f43;
  --primary-soft: #f6e3d8;
  --accent: #6a994e;
  --accent-soft: #e4f0dc;
  --text: #3a352f;
  --text-strong: #2b2722;
  --muted: #978c81;
  --border: #ece2d4;
  --shadow: 0 8px 30px rgba(120, 90, 60, 0.08);
  --shadow-hover: 0 14px 40px rgba(120, 90, 60, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 880px;
  --serif: "Georgia", "Songti SC", "STSong", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-warm), transparent 60%),
    var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(10px);
  background: rgba(250, 246, 240, 0.82);
  border-bottom: 1px solid var(--border);
}
.site-header .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-strong);
}
.brand .logo { font-size: 24px; }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--text); }
.nav-links a.active { background: var(--primary-soft); color: var(--primary-dark); }

/* ---------- 首页 Hero ---------- */
.hero {
  padding: 56px 0 28px;
  text-align: center;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 40px;
  margin: 0 0 12px;
  color: var(--text-strong);
  letter-spacing: 0.5px;
}
.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}
.hero .wave { font-size: 30px; }

/* ---------- 标签筛选 ---------- */
.tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 10px 0 30px;
}
.tag-chip {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.18s ease;
  user-select: none;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary-dark); }
.tag-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(201, 123, 90, 0.3);
}
.tag-chip .count {
  opacity: 0.7;
  margin-left: 6px;
  font-size: 12px;
}

/* ---------- 文章列表 ---------- */
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--text-strong);
  margin: 8px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 6px; height: 22px;
  border-radius: 4px;
  background: var(--primary);
}

.post-list { display: grid; gap: 18px; padding-bottom: 30px; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  display: block;
  color: inherit;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-soft);
}
.post-card h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--text-strong);
  line-height: 1.4;
}
.post-card .meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.post-card .date::before { content: "📅 "; }
.post-card .excerpt { color: var(--text); margin: 0 0 14px; font-size: 15.5px; }
.post-card .tags { display: flex; gap: 8px; flex-wrap: wrap; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 16px;
}

/* ---------- 标签小标签（通用） ---------- */
.tag {
  display: inline-block;
  font-size: 12.5px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #4d7a36;
  font-weight: 500;
}

/* ---------- 文章详情 ---------- */
.post-detail { padding: 36px 0 20px; }
.post-detail .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14.5px;
  margin-bottom: 22px;
}
.post-detail .back:hover { color: var(--primary-dark); }
.post-detail h1 {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--text-strong);
  margin: 0 0 14px;
  line-height: 1.35;
}
.post-detail .meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.post-detail .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.divider { height: 1px; background: var(--border); margin: 0 0 28px; }

/* ---------- Markdown 渲染样式 ---------- */
.markdown { font-size: 16.5px; color: var(--text); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  font-family: var(--serif);
  color: var(--text-strong);
  line-height: 1.4;
  margin: 1.6em 0 0.6em;
}
.markdown h2 { font-size: 25px; border-left: 4px solid var(--primary); padding-left: 12px; }
.markdown h3 { font-size: 20px; }
.markdown p { margin: 0.9em 0; }
.markdown ul, .markdown ol { padding-left: 1.5em; margin: 0.8em 0; }
.markdown li { margin: 0.35em 0; }
.markdown blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 4px solid var(--primary);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #5b5249;
  font-style: italic;
}
.markdown code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--bg-warm);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--primary-dark);
}
.markdown pre {
  background: #2c2722;
  color: #f3ebe0;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.2em 0;
  line-height: 1.6;
}
.markdown pre code { background: none; color: inherit; padding: 0; font-size: 0.88em; }
.markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 15px;
}
.markdown th, .markdown td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.markdown th { background: var(--surface-2); color: var(--text-strong); }
.markdown img { max-width: 100%; border-radius: var(--radius-sm); }
.markdown a { text-decoration: underline; text-underline-offset: 3px; }
.markdown hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- 关于页 ---------- */
.about-wrap { padding: 36px 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 0 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.site-footer .heart { color: var(--primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .hero h1 { font-size: 30px; }
  .post-detail h1 { font-size: 26px; }
  .nav-links a { padding: 7px 10px; font-size: 14px; }
  .brand { font-size: 18px; }
}
