/* ===== Design System =====
   Brand:      #2563eb (blue-600) primary
   Surface:    #ffffff (white)
   Background: #f1f5f9 (slate-100)
   Text:       #0f172a (slate-900) primary
               #475569 (slate-600) secondary
               #94a3b8 (slate-400) muted
   Border:     #e2e8f0 (slate-200)
   Font:       system-ui, -apple-system, 'Inter', sans-serif
   Mono:       'JetBrains Mono', 'Fira Code', monospace
   Radius:     8px (base), 12px (card), 999px (pill)
*/

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
  line-height: 1.7;
  color: #0f172a;
  background: #f1f5f9;
  -webkit-font-smoothing: antialiased;
}

/* ===== Container ===== */
.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.site-header .logo { font-size: 1.1rem; font-weight: 700; color: #0f172a; text-decoration: none; }
.site-header .logo span { color: #2563eb; }
.site-header nav { display: flex; gap: 2px; }
.site-header nav a {
  color: #64748b;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s;
}
.site-header nav a:hover { color: #0f172a; background: #f1f5f9; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  color: #fff;
  padding: 72px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 60%, rgba(37,99,235,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 400px 300px at 80% 30%, rgba(99,102,241,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.hero .subtitle { font-size: 1.1rem; color: #cbd5e1; font-weight: 400; }
.hero .desc { font-size: 0.92rem; color: #94a3b8; max-width: 480px; margin: 8px auto 0; }

/* Hero stats */
.hero-stats { display: flex; justify-content: center; gap: 48px; margin-top: 32px; }
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 700; color: #fff; }
.hero-stat-label { font-size: 0.75rem; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* ===== Articles Section ===== */
.section-articles { padding: 56px 0 48px; }
.section-articles h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 24px;
}

/* ===== Card Grid ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
  transition: all 0.2s;
}
.card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.card h3 { font-size: 1rem; margin: 8px 0 4px; line-height: 1.5; }
.card h3 a { color: #0f172a; text-decoration: none; display: block; transition: color 0.15s; }
.card h3 a:hover { color: #2563eb; }
.card p { font-size: 0.88rem; color: #64748b; margin-bottom: 10px; line-height: 1.6; }
.card .meta { font-size: 0.8rem; color: #94a3b8; }

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-agent { background: #eff6ff; color: #1d4ed8; }
.tag-linux { background: #f0fdf4; color: #15803d; }
.tag-docker { background: #ecfeff; color: #0e7490; }
.tag-web { background: #fff7ed; color: #c2410c; }
.tag-vpn { background: #f0fdfa; color: #0d9488; }
.tag-security { background: #fef2f2; color: #b91c1c; }
.tag-backup { background: #faf5ff; color: #7c3aed; }
.tag-wiki { background: #eef2ff; color: #4338ca; }
.tag-network { background: #ecfeff; color: #0e7490; }
.tag-deploy { background: #fff7ed; color: #9a3412; }
.tag-devops { background: #f0f9ff; color: #0369a1; }

/* ===== Article Header ===== */
.article-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 36px 0 24px;
}
.article-header h1 { font-size: 1.8rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 12px; color: #0f172a; }
.article-header .meta {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-top: 8px;
}
.article-header .meta .author { display: inline-flex; align-items: center; gap: 6px; }
.author-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #2563eb; color: #fff;
  font-size: 0.75rem; font-weight: 700;
}

/* ===== Article Content ===== */
.article-content { padding: 40px 0 60px; background: #fff; }
.article-content h2 {
  font-size: 1.4rem; margin: 40px 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0; color: #0f172a; font-weight: 700;
}
.article-content h3 { font-size: 1.12rem; margin: 28px 0 10px; color: #1e293b; font-weight: 600; }
.article-content p { margin-bottom: 16px; color: #334155; line-height: 1.75; }
.article-content ul, .article-content ol { margin: 12px 0 16px 24px; }
.article-content li { margin-bottom: 8px; color: #334155; }
.article-content a { color: #2563eb; text-decoration: none; border-bottom: 1px solid transparent; }
.article-content a:hover { border-bottom-color: #2563eb; }

/* Code */
.article-content code {
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px;
  font-size: 0.87em; font-family: 'JetBrains Mono', 'Fira Code', monospace;
  color: #e11d48;
}
.article-content pre {
  background: #0f172a; color: #e2e8f0;
  padding: 20px 24px; border-radius: 10px; overflow-x: auto;
  font-size: 0.86rem; margin: 20px 0; line-height: 1.65;
  border: 1px solid #1e293b;
}
.article-content pre code { background: none; padding: 0; color: inherit; }

/* Blockquote */
.article-content blockquote {
  border-left: 3px solid #2563eb; padding: 16px 20px; margin: 20px 0;
  background: #f8fafc; color: #475569; border-radius: 0 8px 8px 0;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

/* Callout */
.article-content .callout {
  border-radius: 8px; padding: 16px 20px; margin: 20px 0;
  display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem;
}
.article-content .callout-icon { flex-shrink: 0; font-size: 1.1rem; line-height: 1.6; }
.article-content .callout-content { flex: 1; }
.article-content .callout-tip { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.article-content .callout-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.article-content .callout-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* Highlight */
.article-content .highlight { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px 24px; margin: 20px 0; }

/* FAQ */
.article-content .faq-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid #e2e8f0; }
.article-content .faq-item { margin-bottom: 20px; }
.article-content .faq-question { font-weight: 600; color: #0f172a; margin-bottom: 4px; }

/* Table */
.article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.88rem; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.article-content th { background: #f8fafc; padding: 12px 16px; text-align: left; font-weight: 600; border-bottom: 1px solid #e2e8f0; }
.article-content td { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; }
.article-content tr:last-child td { border-bottom: none; }

/* Image */
.article-content img { max-width: 100%; border-radius: 10px; margin: 24px 0; box-shadow: 0 1px 8px rgba(0,0,0,0.06); }

/* ===== TOC ===== */
/* TOC heading override */
.toc h2 {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin: 0 0 10px;
  padding: 0;
  border: none;
}
.toc { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px 20px; margin: 0 0 28px; }
.toc h3 { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-bottom: 10px; }
.toc ul { margin: 0; padding-left: 0; list-style: none; }
.toc a { display: flex; padding: 5px 0; color: #475569; text-decoration: none; font-size: 0.9rem; border-bottom: 1px solid #f1f5f9; gap: 8px; }
.toc a::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: #cbd5e1; margin-top: 10px; flex-shrink: 0; }
.toc li:last-child a { border-bottom: none; }
.toc a:hover { color: #2563eb; }
.toc a:hover::before { background: #2563eb; }

/* ===== Author Bio ===== */
.author-bio { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 24px; margin: 40px 0 24px; display: flex; gap: 16px; align-items: flex-start; }
.author-bio-avatar { width: 44px; height: 44px; border-radius: 50%; background: #2563eb; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1rem; flex-shrink: 0; }
.author-bio-content { flex: 1; }
.author-bio-content p { margin: 2px 0; color: #475569; font-size: 0.88rem; }
.author-bio-content strong { color: #0f172a; font-size: 0.9rem; display: block; margin-bottom: 4px; }

/* ===== Article Nav ===== */
.article-nav { margin-top: 40px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.article-nav a { color: #2563eb; text-decoration: none; font-weight: 500; font-size: 0.92rem; }

/* ===== Footer ===== */
.site-footer { background: #0f172a; border-top: none; padding: 40px 0; text-align: center; }
.site-footer .footer-links { margin-bottom: 12px; display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; }
.site-footer .footer-links a { color: #94a3b8; text-decoration: none; padding: 4px 12px; font-size: 0.85rem; transition: color 0.2s; }
.site-footer .footer-links a:hover { color: #fff; }
.site-footer .footer-links span { color: #334155; }
.site-footer .footer-copy { color: #64748b; font-size: 0.78rem; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .hero { padding: 48px 0 36px; }
  .hero-stats { gap: 28px; margin-top: 24px; }
  .hero-stat-num { font-size: 1.3rem; }
  .card-grid { grid-template-columns: 1fr; }
  .nav-bar .container { height: 46px; }
  .nav-bar a { padding: 6px 12px; font-size: 0.84rem; }
  .article-header h1 { font-size: 1.35rem; }
  .article-content h2 { font-size: 1.2rem; }
  .container { padding: 0 16px; }
}

/* ===== Utilities ===== */
::selection { background: #2563eb; color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
/* ===== Category Page ===== */
.cat-list { list-style: none; padding: 0; }
.cat-item {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 8px 12px;
  padding: 16px 20px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s;
}
.cat-item:hover { border-color: #2563eb; box-shadow: 0 2px 8px rgba(37,99,235,0.08); }
.cat-item .tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; font-weight: 600; letter-spacing: 0.04em; }
.cat-title { font-weight: 600; color: #0f172a; text-decoration: none; font-size: 0.95rem; }
.cat-title:hover { color: #2563eb; }
.cat-date { font-size: 0.8rem; color: #94a3b8; margin-left: auto; }
.cat-desc { width: 100%; font-size: 0.85rem; color: #64748b; line-height: 1.5; margin: 0; }

/* Category tag colors */
.cat-item .tag-automation { background: #f0fdf4; color: #16a34a; }
.cat-item .tag-backup { background: #fff7ed; color: #ea580c; }
.cat-item .tag-wiki { background: #f0f9ff; color: #0284c7; }
.cat-item .tag-network { background: #f5f3ff; color: #7c3aed; }
.cat-item .tag-docker { background: #f0fdfa; color: #0d9488; }
.cat-item .tag-web { background: #fffbeb; color: #d97706; }
.cat-item .tag-agent { background: #eff6ff; color: #2563eb; }
.cat-item .tag-linux { background: #f0fdf4; color: #16a34a; }
.cat-item .tag-security { background: #fef2f2; color: #dc2626; }
.cat-item .tag-vpn { background: #f5f3ff; color: #7c3aed; }
.cat-item .tag-general { background: #f1f5f9; color: #64748b; }

/* ===== Navigation ===== */
.nav-bar {
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0;
  position: sticky; top: 0; z-index: 100;
}
.nav-bar .container { display: flex; align-items: center; height: 52px; }
.nav-bar ul { list-style: none; display: flex; gap: 2px; padding: 0; margin: 0; }
.nav-bar li { margin: 0; }
.nav-bar a {
  color: #94a3b8;
  text-decoration: none;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s;
}
.nav-bar a:hover { color: #fff; background: #1e293b; }
@media (max-width: 640px) {
  .nav-bar .container { height: 46px; }
  .nav-bar a { padding: 6px 12px; font-size: 0.84rem; }
}