/* ================================================
   人工和智能 — 博客样式 v2
   ================================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* Reset & Base */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --tag-bg: #f3f4f6;
  --tag-text: #374151;
  --code-bg: #f1f5f9;
  --code-text: #e11d48;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 16px rgba(79,70,229,0.15);
  --max-w: 800px;
  --font: 'Noto Sans SC', -apple-system, 'PingFang SC', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.site-title-wrap { display: flex; align-items: center; gap: 0.6rem; }
.site-icon { font-size: 1.5rem; }
.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-title:hover { color: var(--accent); text-decoration: none; }

nav { display: flex; gap: 0.25rem; }
nav a {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
}
nav a:hover, nav a.active {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d5a 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
  margin: 0;
  border-radius: 0;
}
.hero .container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.hero .subtitle {
  font-size: 1.05rem;
  opacity: 0.75;
  max-width: 560px;
  line-height: 1.6;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.hero .subtitle {
  font-size: 1.05rem;
  opacity: 0.75;
  max-width: 560px;
  line-height: 1.6;
}

/* Section titles */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* Post Cards */
.post-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.post-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}
.post-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  line-height: 1.4;
}
.post-card .excerpt {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.post-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-size: 0.75rem;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-weight: 500;
}
.tag.accent { background: var(--accent-light); color: var(--accent); }

/* Single Post */
.post-single {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.post-single header { margin-bottom: 2rem; }
.post-single h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.post-single .post-date {
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.post-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.5rem; }

/* Content Typography */
.content { font-size: 0.975rem; }
.content p { margin: 0.85rem 0; }
.content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.content a { color: var(--accent); }
.content a:hover { text-decoration: underline; }
.content ul, .content ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}
.content li { margin: 0.3rem 0; }
.content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  padding: 0.75rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  color: #3730a3;
  font-style: italic;
}
.content code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  font-size: 0.875em;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
}
.content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}
.content pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.content th {
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 600;
}
.content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}
.content tr:nth-child(even) td { background: #f9fafb; }

/* Back link */
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.15s;
  margin-top: 1.5rem;
}
.back:hover {
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}

/* Tag/Cat index pages */
.tag-list, .category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.tag-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
.tag-count {
  background: var(--tag-bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 600px) {
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.5rem; }
  .post-single { padding: 1.5rem; }
  .site-header .container { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  nav { gap: 0.15rem; }
  nav a { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
}
