/* ========================================
   清风博客 - 全局样式
   ======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1e293b;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-muted: #f1f5f9;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 8px;
  --max-width: 1100px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Roboto Mono", "Courier New", monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

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

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

.site-logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.site-logo span { color: var(--primary); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
}

.nav-links a:hover, .nav-links a.active { color: var(--primary); }

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: width 0.25s;
}

.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  border-radius: 2px;
  transition: 0.25s;
}

/* 主内容区 */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
  width: 100%;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}

/* Banner */
.page-banner { margin-bottom: 2.5rem; }
.page-banner h1 { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.02em; }
.page-banner p { color: var(--text-light); margin-top: 0.5rem; font-size: 1.05rem; }

/* 文章卡片 */
.post-list { display: flex; flex-direction: column; gap: 1.5rem; }

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.post-card:hover { box-shadow: var(--shadow-md); border-color: #cbd5e1; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-lighter);
}

.post-tag {
  background: var(--bg-muted);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

.post-card h2 { font-size: 1.3rem; font-weight: 650; line-height: 1.4; margin-bottom: 0.6rem; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--primary); }
.post-excerpt { color: var(--text-light); font-size: 0.95rem; line-height: 1.7; }
.read-more { display: inline-block; margin-top: 1rem; font-size: 0.9rem; font-weight: 500; }

/* 侧边栏 */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.widget-title {
  font-size: 1rem;
  font-weight: 650;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.about-widget .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #c7d2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.85rem;
}

.about-widget p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; }

.category-list { list-style: none; }
.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}
.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text-light); font-size: 0.9rem; }
.category-list a:hover { color: var(--primary); }
.category-list .count {
  background: var(--bg-muted);
  color: var(--text-lighter);
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-cloud a {
  background: var(--bg-muted);
  color: var(--text-light);
  font-size: 0.82rem;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s;
}
.tag-cloud a:hover { background: var(--primary); color: #fff; }

/* 文章详情页 */
.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-header h1 { font-size: 1.85rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.article-meta { display: flex; align-items: center; gap: 1.25rem; margin-top: 1rem; font-size: 0.88rem; color: var(--text-lighter); }
.article-meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-lighter); display: inline-block; }

.article-content { font-size: 1.05rem; line-height: 1.85; color: #334155; }
.article-content h2 { font-size: 1.4rem; font-weight: 650; margin: 2.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }
.article-content h3 { font-size: 1.15rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.article-content p { margin-bottom: 1.25rem; }
.article-content ul, .article-content ol { margin: 1rem 0 1.25rem 1.5rem; }
.article-content li { margin-bottom: 0.4rem; }

.article-content blockquote {
  border-left: 3px solid var(--primary);
  background: var(--bg-muted);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-light);
  font-style: italic;
}

.article-content code {
  background: var(--bg-muted);
  color: #e11d48;
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.article-content strong { font-weight: 600; color: var(--text); }

/* 文章底部导航 */
.article-nav { display: flex; justify-content: space-between; gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.article-nav a { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; transition: all 0.2s; }
.article-nav a:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.article-nav .label { font-size: 0.82rem; color: var(--text-lighter); display: block; margin-bottom: 0.35rem; }
.article-nav .title { font-size: 0.95rem; font-weight: 500; color: var(--text); }
.article-nav .next { text-align: right; }

/* 关于页面 */
.about-page { max-width: 720px; }
.about-page h1 { font-size: 1.85rem; font-weight: 700; margin-bottom: 1.5rem; letter-spacing: -0.02em; }
.about-content { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; }
.about-content p { color: var(--text-light); font-size: 1.02rem; line-height: 1.85; margin-bottom: 1.25rem; }
.about-content p:last-child { margin-bottom: 0; }
.about-content h2 { font-size: 1.2rem; font-weight: 650; margin: 2rem 0 0.85rem; }
.about-content h2:first-child { margin-top: 0; }
.about-content ul { list-style: none; margin: 0.75rem 0 1.25rem; }
.about-content ul li { padding: 0.4rem 0 0.4rem 1.25rem; position: relative; color: var(--text-light); font-size: 0.98rem; }
.about-content ul li::before { content: ""; position: absolute; left: 0; top: 0.85rem; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* 页脚 */
.site-footer { background: var(--bg); border-top: 1px solid var(--border); margin-top: auto; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 1.75rem 1.5rem; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1rem; list-style: none; }
.footer-links a { color: var(--text-lighter); font-size: 0.88rem; }
.footer-links a:hover { color: var(--primary); }
.footer-info { color: var(--text-lighter); font-size: 0.84rem; line-height: 1.8; }
.footer-info a { color: var(--text-lighter); }
.footer-info a:hover { color: var(--primary); }

/* 响应式 */
@media (max-width: 860px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 1.5rem;
    gap: 0;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--border); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a { display: block; padding: 0.75rem 0; }
  .mobile-toggle { display: block; }
  .post-card { padding: 1.25rem 1.5rem; }
  .page-banner h1 { font-size: 1.5rem; }
  .article-header h1 { font-size: 1.5rem; }
  .sidebar { grid-template-columns: 1fr; }
  .article-nav { flex-direction: column; }
  .about-content { padding: 1.5rem; }
  .footer-links { flex-direction: column; gap: 0.5rem; }
}
