/* 格序技术分享 - 编程技术分享站点样式 */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --code-bg: #f1f5f9;
  --radius: 8px;
  --max-width: 960px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.main-nav { display: flex; gap: 24px; }
.main-nav a {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--primary);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.hero h1 { font-size: 2.4rem; margin-bottom: 16px; }
.hero-subtitle { font-size: 1.15rem; opacity: 0.9; margin-bottom: 28px; }
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  transition: all 0.2s;
}
.btn-primary {
  background: #fff;
  color: var(--primary);
}
.btn-primary:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: 1.6rem;
  margin-bottom: 32px;
  text-align: center;
}

/* Article grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.article-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  transform: translateY(-4px);
}
.article-card h3 { margin: 12px 0; font-size: 1.15rem; }
.article-card p { color: var(--text-light); font-size: 0.92rem; }
.read-more { font-size: 0.9rem; font-weight: 600; }

/* Tags */
.tag {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* Tech grid */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.tech-item {
  text-align: center;
  padding: 24px;
}
.tech-item h3 { margin-bottom: 8px; font-size: 1.1rem; }
.tech-item p { color: var(--text-light); font-size: 0.9rem; }

/* Article list */
.page-title { font-size: 2rem; margin-bottom: 8px; }
.page-desc { color: var(--text-light); margin-bottom: 40px; }
.article-list { display: flex; flex-direction: column; gap: 28px; }
.article-item {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: box-shadow 0.2s;
}
.article-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.article-meta time { color: var(--text-light); font-size: 0.85rem; }
.article-item h2 { font-size: 1.3rem; margin-bottom: 8px; }
.article-item p { color: var(--text-light); font-size: 0.95rem; }

/* Article detail */
.article-detail { padding: 48px 0; }
.article-header { margin-bottom: 32px; text-align: center; }
.article-header h1 { font-size: 2rem; margin: 16px 0 8px; }
.article-header time { color: var(--text-light); font-size: 0.9rem; }
.article-content { max-width: 720px; margin: 0 auto; }
.article-content h2 { font-size: 1.4rem; margin: 32px 0 12px; }
.article-content p { margin-bottom: 16px; color: #334155; }
.article-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0 24px;
}
.article-content code {
  font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.88rem;
}
.article-content p code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-nav { margin-top: 48px; text-align: center; }

/* About */
.about-content { max-width: 640px; margin: 0 auto; }
.about-content h2 { margin: 32px 0 12px; }

/* Footer */
.site-footer {
  background: #1e293b;
  color: #cbd5e1;
  padding: 40px 0 24px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.footer-info p { font-size: 0.9rem; color: #94a3b8; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: #cbd5e1; font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-bottom p { font-size: 0.85rem; color: #94a3b8; }
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }
.footer-bottom p a + a { margin-left: 12px; }

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }
  .main-nav { gap: 16px; }
  .header-inner { height: 52px; }
}
