/* ============================================
   个人博客样式表 - 现代设计
   ============================================ */

:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --text-link: #4f46e5;
  --border: #e5e7eb;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --tag-bg: #eef2ff;
  --tag-text: #4f46e5;
  --code-bg: #f3f4f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.10), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 14px;
}

[data-theme="dark"] {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-nav: rgba(26, 26, 46, 0.85);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --text-link: #818cf8;
  --border: #2d2d4a;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --tag-bg: #1e1e3a;
  --tag-text: #a5b4fc;
  --code-bg: #2a2a44;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-hover: 0 10px 25px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: var(--bg-nav); border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 820px; margin: 0 auto; padding: 0.9rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.brand {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 50%;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; transition: transform 0.2s, box-shadow 0.2s; color: var(--text);
}
.theme-toggle:hover { transform: scale(1.1); box-shadow: var(--shadow); }

.container { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.hero { text-align: center; padding: 3rem 0 2.5rem; }
.hero h1 { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; margin-bottom: 1rem; }
.hero .tagline { font-size: 1.15rem; color: var(--text-muted); max-width: 520px; margin: 0 auto; }
.hero .avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  margin: 0 auto 1.5rem; display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 700; color: #fff; box-shadow: var(--shadow-hover);
}

.section-title {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  margin: 2rem 0 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--border);
}

.post-list { list-style: none; }

.post-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.8rem; margin-bottom: 1.2rem;
  text-decoration: none; color: inherit;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s;
}
.post-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--accent); text-decoration: none; }
.post-card h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.post-card .excerpt { color: var(--text-muted); font-size: 0.98rem; margin-bottom: 1rem; }

.post-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; }
.post-meta .tag { background: var(--tag-bg); color: var(--tag-text); padding: 0.15rem 0.6rem; border-radius: 6px; font-size: 0.78rem; font-weight: 500; }

.article-header { margin-bottom: 2.5rem; }
.article-header h1 { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 1rem; }
.article-header .meta { color: var(--text-muted); font-size: 0.9rem; }

.article-body { font-size: 1.08rem; line-height: 1.85; }
.article-body h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; }
.article-body p { margin-bottom: 1.2rem; }
.article-body code { background: var(--code-bg); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; font-family: "SF Mono", "Fira Code", Consolas, monospace; }
.article-body pre { background: var(--code-bg); padding: 1.2rem; border-radius: 10px; overflow-x: auto; margin: 1.5rem 0; }
.article-body pre code { background: none; padding: 0; }
.article-body blockquote { border-left: 4px solid var(--accent); padding-left: 1rem; color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }
.article-body img { max-width: 100%; border-radius: 10px; margin: 1.5rem 0; }

.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.back-link:hover { color: var(--accent); text-decoration: none; }

footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 2rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.88rem; }
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 1rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero .tagline { font-size: 1rem; }
  .article-header h1 { font-size: 1.8rem; }
  .nav-inner { padding: 0.8rem 1rem; }
  .container { padding: 1.5rem 1rem; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.5s ease forwards; }
.post-card { animation: fadeIn 0.4s ease forwards; opacity: 0; }
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.12s; }
.post-card:nth-child(3) { animation-delay: 0.19s; }
.post-card:nth-child(4) { animation-delay: 0.26s; }
