/* 个人博客 - 样式 */
:root {
  --bg: #faf9f7;
  --bg-card: #fff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #2d5a27;
  --accent-hover: #3d7a35;
  --border: #e8e6e3;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);
  --radius: 14px;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Noto Serif SC', Georgia, 'Songti SC', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
}

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

::selection {
  background: rgba(45, 90, 39, 0.15);
  color: var(--text);
}

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

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

.nav .logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

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

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
  outline: none;
}

/* 主内容 */
.main {
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

/* 首屏 */
.hero {
  text-align: center;
  padding: 4.5rem 0 5rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 28em;
  margin: 0 auto;
  line-height: 1.6;
}

/* 文章列表 */
.articles {
  padding: 0.5rem 0;
}

.articles h2 {
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  margin-bottom: 1.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.article-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(45, 90, 39, 0.12);
  transform: translateY(-3px);
}

.card a {
  display: block;
  padding: 1.75rem 2rem;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

.card a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: block;
  letter-spacing: 0.02em;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.65;
}

.card-link {
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.card:hover .card-link {
  color: var(--accent-hover);
}

/* 文章内页 */
.article-page .main {
  padding-top: 1.5rem;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-header .back {
  display: inline-block;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.2s;
}

.article-header .back:hover {
  color: var(--accent);
}

.article-header .date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.article-body {
  font-size: 1.05rem;
}

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.25rem 0 0.85rem;
  color: var(--text);
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.1rem;
  color: var(--text);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.1rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--border);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  color: var(--accent);
}

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

.site-footer p {
  margin: 0;
}

.site-footer .footer-icp {
  margin-top: 0.5rem;
}

.site-footer .footer-icp a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-icp a:hover,
.site-footer .footer-icp a:focus-visible {
  color: var(--accent);
  outline: none;
}

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .main {
    padding: 2rem 1.25rem 3rem;
  }
  .hero {
    padding: 3rem 0 4rem;
  }
  .hero h1 {
    font-size: 1.75rem;
  }
  .card a {
    padding: 1.5rem 1.5rem;
  }
  .article-header h1 {
    font-size: 1.5rem;
  }
}
