/* ============================================================
   晚风集 · 个人博客样式
   ============================================================ */
:root {
  --bg: #faf8f4;
  --bg-alt: #f2ede5;
  --card: #ffffff;
  --text: #2f2b27;
  --text-soft: #6f6860;
  --text-faint: #a39b90;
  --accent: #b5613f;
  --accent-soft: #f6e6dd;
  --border: #ebe4da;
  --shadow: 0 6px 24px rgba(90, 70, 50, 0.07);
  --shadow-hover: 0 12px 36px rgba(90, 70, 50, 0.13);
  --radius: 14px;
  --serif: Georgia, "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --bg: #171614;
  --bg-alt: #201e1b;
  --card: #23211e;
  --text: #ece6dd;
  --text-soft: #b0a89c;
  --text-faint: #7f776d;
  --accent: #e08a63;
  --accent-soft: #3a2b23;
  --border: #33302b;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 12px 36px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-family: var(--sans);
}
.nav-menu { display: flex; align-items: center; gap: 6px; }
.nav-menu a {
  padding: 8px 15px; border-radius: 9px; font-size: 15px; color: var(--text-soft);
  transition: background .2s, color .2s;
}
.nav-menu a:hover, .nav-menu a.active { background: var(--accent-soft); color: var(--accent); }
.theme-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); cursor: pointer; font-size: 18px;
  display: grid; place-items: center; transition: transform .2s, background .2s;
}
.theme-btn:hover { transform: rotate(15deg); background: var(--bg-alt); }
.menu-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 68px 24px 52px; position: relative; }
.hero::before {
  content: ""; position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  width: 320px; height: 200px; background: var(--accent); opacity: .07;
  filter: blur(70px); border-radius: 50%; pointer-events: none;
}
.hero .eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 16px; }
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 6vw, 54px); line-height: 1.25; letter-spacing: 2px; }
.hero .tagline { color: var(--text-soft); font-size: 17px; margin-top: 14px; }
.hero .stats { margin-top: 26px; display: flex; gap: 30px; justify-content: center; color: var(--text-faint); font-size: 13px; }
.hero .stats b { color: var(--accent); font-size: 18px; font-family: var(--serif); margin-right: 4px; }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 42px; align-items: start; padding-bottom: 80px; }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; }
.search-box {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 11px;
  padding: 0 14px; height: 44px; transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box span { color: var(--text-faint); font-size: 16px; }
.search-box input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font-size: 14px; font-family: var(--sans); }
.search-box input::placeholder { color: var(--text-faint); }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tabs button {
  border: 1px solid var(--border); background: var(--card); color: var(--text-soft);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-family: var(--sans);
  transition: all .2s;
}
.cat-tabs button:hover { border-color: var(--accent); color: var(--accent); }
.cat-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; gap: 18px; }
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: pointer; position: relative; overflow: hidden;
}
.post-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); transform: scaleY(0); transform-origin: top; transition: transform .25s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--accent); }
.post-card:hover::before { transform: scaleY(1); }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-faint); margin-bottom: 10px; }
.cat-badge { padding: 3px 10px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.post-card h2 { font-family: var(--serif); font-size: 23px; line-height: 1.4; margin-bottom: 10px; transition: color .2s; }
.post-card:hover h2 { color: var(--accent); }
.post-card .excerpt { color: var(--text-soft); font-size: 14.5px; line-height: 1.8; }
.post-card .foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; color: var(--text-soft); background: var(--bg-alt); padding: 3px 10px; border-radius: 6px; }
.read-more { color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.read-more::after { content: " →"; transition: margin .2s; }
.post-card:hover .read-more::after { margin-left: 4px; }

.empty { text-align: center; padding: 70px 20px; color: var(--text-faint); }
.empty .big { font-size: 46px; margin-bottom: 10px; }

/* ---------- 侧边栏 ---------- */
.sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 20px; }
.widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.widget h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--accent-soft); display: inline-block; }
.about-me { text-align: center; }
.avatar {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--accent), #d9916b); color: #fff;
  display: grid; place-items: center; font-family: var(--serif); font-size: 28px;
}
.about-me .name { font-family: var(--serif); font-size: 18px; font-weight: 700; }
.about-me .bio { color: var(--text-soft); font-size: 13px; line-height: 1.75; margin-top: 8px; text-align: left; }
.social { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.social a { font-size: 12.5px; color: var(--accent); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; transition: background .2s; }
.social a:hover { background: var(--accent-soft); }
.cat-list, .tag-cloud, .recent-list { list-style: none; }
.cat-list li, .recent-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.cat-list li:last-child, .recent-list li:last-child { border-bottom: none; }
.cat-list a:hover, .recent-list a:hover { color: var(--accent); }
.count { color: var(--text-faint); font-size: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { font-size: 12.5px; color: var(--text-soft); background: var(--bg-alt); padding: 5px 11px; border-radius: 7px; transition: all .2s; }
.tag-cloud a:hover { background: var(--accent); color: #fff; }
.recent-list a { display: block; line-height: 1.5; font-size: 13.5px; }
.recent-list .rd { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* ---------- 文章正文页 ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 50px 24px 90px; }
.back-link { color: var(--accent); font-size: 14px; display: inline-block; margin-bottom: 28px; }
.back-link:hover { text-decoration: underline; }
.article-head { text-align: center; margin-bottom: 44px; }
.article-head .post-meta { justify-content: center; }
.article-head h1 { font-family: var(--serif); font-size: clamp(30px, 5vw, 42px); line-height: 1.35; margin: 12px 0 18px; }
.article-cover {
  height: 300px; border-radius: var(--radius); margin-bottom: 40px;
  background-size: cover; background-position: center;
  display: grid; place-items: center; color: rgba(255,255,255,.9);
  font-family: var(--serif); font-size: 32px; letter-spacing: 4px;
}
.article-cover.default {
  background: linear-gradient(135deg, #c07b58, #a85436 55%, #7d3d28);
}
.article-body { font-size: 16.5px; line-height: 2; color: var(--text); }
.article-body p { margin-bottom: 22px; }
.article-body h2 { font-family: var(--serif); font-size: 25px; margin: 40px 0 18px; padding-left: 14px; border-left: 4px solid var(--accent); }
.article-body blockquote {
  margin: 28px 0; padding: 18px 24px; background: var(--accent-soft);
  border-radius: 10px; color: var(--text-soft); font-family: var(--serif);
  font-style: italic; font-size: 17px; border-left: 3px solid var(--accent);
}
.article-body ul, .article-body ol { margin: 0 0 22px 24px; }
.article-body li { margin-bottom: 10px; }
.article-body strong { color: var(--accent); }
.article-end { margin-top: 50px; padding-top: 28px; border-top: 1px solid var(--border); text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- 关于页 ---------- */
.about-hero { text-align: center; padding: 50px 0 30px; }
.about-hero .avatar { width: 96px; height: 96px; font-size: 40px; }
.about-hero h1 { font-family: var(--serif); font-size: 34px; margin-top: 6px; }
.about-content { max-width: 680px; margin: 0 auto; padding: 20px 24px 90px; }
.about-content p { margin-bottom: 20px; font-size: 16px; line-height: 2; color: var(--text-soft); }
.about-content h2 { font-family: var(--serif); font-size: 22px; margin: 36px 0 16px; color: var(--text); }
.contact-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-align: center; margin-top: 30px; box-shadow: var(--shadow); }
.contact-box a { color: var(--accent); font-weight: 600; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; color: var(--text-faint); font-size: 13px; }
.site-footer .heart { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; }
  .nav-menu a { display: none; }
  .menu-toggle { display: grid; }
  .nav-menu.open a { display: block; }
  .nav-menu.open { position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); flex-direction: column; padding: 12px 24px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
}
@media (max-width: 560px) {
  .hero { padding: 46px 20px 36px; }
  .post-card { padding: 20px; }
  .post-card h2 { font-size: 20px; }
  .article-body { font-size: 15.5px; }
}
