/* ============ 全局 ============ */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #2c2c2c;
  --text-muted: #8a8578;
  --accent: #d4622a;
  --accent-soft: #f5e6dc;
  --border: #e8e4da;
  --max-width: 720px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.5px;
}

.site-title span {
  color: var(--accent);
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-muted);
  margin-left: 20px;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav.main-nav a:hover {
  color: var(--accent);
}

/* ============ 主体 ============ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* 首页 hero */
.hero {
  margin-bottom: 56px;
}

.hero h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero p {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* 文章列表 */
.post-list {
  list-style: none;
}

.post-list li {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.post-list a.post-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease;
}

.post-list a.post-link:hover {
  transform: translateX(4px);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.post-meta .tag {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
}

.post-list h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.post-list .excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============ 文章页 ============ */
article.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 48px 44px;
}

article.post h1 {
  font-size: 1.7rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

article.post .post-meta {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

article.post h2 {
  font-size: 1.25rem;
  margin: 36px 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

article.post p {
  margin-bottom: 16px;
}

article.post ul,
article.post ol {
  margin: 0 0 16px 1.4em;
}

article.post li {
  margin-bottom: 6px;
}

article.post blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
  color: #6b5d4f;
  margin-bottom: 16px;
}

/* 相邻引用行无缝拼接：视觉上合并为一个大框 */
article.post blockquote + blockquote { margin-top: 0; border-radius: 0 0 8px 8px; }
article.post blockquote:has(+ blockquote) { margin-bottom: 0; border-radius: 0 8px 8px 0; }

/* 编辑器（Quill WYSIWYG）内同样生效 */
/* 注意：Quill snow 主题自带 .ql-snow .ql-editor blockquote（优先级更高，margin 5px），
   必须用同等以上优先级 + !important 才能覆盖 */
.ql-snow .ql-editor blockquote {
  border-left: 3px solid var(--accent) !important;
  background: var(--accent-soft) !important;
  padding: 8px 14px !important;
  border-radius: 0 8px 8px 0 !important;
  margin: 10px 0 !important;
}
.ql-snow .ql-editor blockquote + blockquote { margin-top: 0 !important; border-radius: 0 0 8px 8px !important; }
.ql-snow .ql-editor blockquote:has(+ blockquote) { margin-bottom: 0 !important; border-radius: 0 8px 8px 0 !important; }

article.post code {
  background: #f1efe9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: Consolas, "JetBrains Mono", monospace;
}

article.post pre {
  background: #2c2c2c;
  color: #e8e4da;
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 0.88rem;
  line-height: 1.6;
}

article.post pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* 返回链接 */
.back-link {
  display: inline-block;
  margin-top: 32px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* ============ 关于页 ============ */
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px;
}

.about-card h1 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.about-card p {
  margin-bottom: 14px;
}

/* ============ 页脚 ============ */
footer.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
  article.post,
  .about-card {
    padding: 28px 20px;
  }

  .nav-inner {
    flex-direction: column;
    gap: 10px;
  }

  nav.main-nav a {
    margin: 0 10px;
  }
}
