/* ================================================================
   Zorro's Linux Book — 平静 · 结构化 · 乐观
   
   配色体系：
   - 柔和米色 #F5F0E8  (背景)
   - 鼠尾草绿 #7A9E7E  (主色调)
   - 温暖灰色 #8B8680  (辅助)
   ================================================================ */

:root {
  --bg: #F5F0E8;
  --bg-white: #FAFAF7;
  --bg-card: #FFFFFF;
  --text: #3D3D3D;
  --text-light: #6B6560;
  --text-muted: #9B9590;
  --sage: #7A9E7E;
  --sage-light: #A8C5AB;
  --sage-lighter: #C8DED0;
  --sage-dark: #5C7F60;
  --warm-gray: #8B8680;
  --light-gray: #E8E4DE;
  --border: #D5D0C8;
  --card-shadow: 0 2px 12px rgba(0,0,0,.04);
  --card-hover-shadow: 0 8px 32px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --max-w: 1080px;
  --transition: all .25s cubic-bezier(.4,0,.2,1);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--sage-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--sage); }

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

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
  background: rgba(250, 250, 247, .85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo h1 { font-size: 1.1rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.subtitle { font-size: .75rem; color: var(--text-muted); margin-top: 1px; }
.logo-icon { font-size: 1.8rem; }
.main-nav { display: flex; gap: 6px; }
.nav-link {
  color: var(--text-light); font-size: .88rem; font-weight: 500;
  padding: 8px 14px; border-radius: 8px; transition: var(--transition);
}
.nav-link:hover { color: var(--sage-dark); background: rgba(122,158,126,.08); }
.nav-link.active { color: var(--sage-dark); background: rgba(122,158,126,.12); font-weight: 600; }
.mobile-menu-btn {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 1.2rem; cursor: pointer;
  color: var(--text-light);
}

/* ================================================================
   HOME HERO
   ================================================================ */
.home-hero {
  position: relative; text-align: center;
  padding: 80px 24px 60px;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: -120px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(122,158,126,.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-avatar {
  font-size: 3.2rem; margin-bottom: 20px;
  display: inline-block;
  background: linear-gradient(135deg, var(--sage-lighter), var(--sage-light));
  width: 80px; height: 80px; line-height: 80px; border-radius: 50%;
  box-shadow: 0 4px 24px rgba(122,158,126,.2);
}
.hero-title {
  font-size: 2.2rem; font-weight: 800; color: var(--text);
  letter-spacing: -.5px; margin-bottom: 4px;
}
.hero-subtitle {
  font-size: 1.1rem; color: var(--sage); font-weight: 500;
  margin-bottom: 16px;
}
.hero-desc {
  font-size: .95rem; color: var(--text-light); max-width: 480px;
  margin: 0 auto 20px; line-height: 1.8;
}
.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.badge {
  font-size: .78rem; padding: 4px 14px; border-radius: 20px;
  background: rgba(122,158,126,.1); color: var(--sage-dark);
  border: 1px solid rgba(122,158,126,.2); font-weight: 500;
}

/* ================================================================
   HOME GRID LAYOUT
   ================================================================ */
.home-sections { padding: 0 0 64px; }
.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* --- Block Base --- */
.home-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}
.home-block:hover { box-shadow: var(--card-hover-shadow); }
.home-block-wide { grid-column: 1 / -1; }
.home-block-accent {
  background: linear-gradient(135deg, rgba(122,158,126,.08), rgba(168,197,171,.05));
  border-color: var(--sage-lighter);
}

.block-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--light-gray);
}
.block-header h2 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.block-more { font-size: .85rem; color: var(--sage); font-weight: 500; }
.block-more:hover { color: var(--sage-dark); }

/* --- Post List --- */
.block-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.block-post-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.block-post-item:hover { background: rgba(122,158,126,.06); }
.block-post-cat {
  font-size: .7rem; padding: 2px 10px; border-radius: 12px;
  background: rgba(122,158,126,.1); color: var(--sage-dark);
  white-space: nowrap; font-weight: 500;
}
.block-post-title {
  font-size: .9rem; color: var(--text); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.block-post-item:hover .block-post-title { color: var(--sage-dark); }

/* --- Demo List --- */
.block-demo-list { display: flex; flex-direction: column; gap: 10px; }
.block-demo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--light-gray); transition: var(--transition);
}
.block-demo-item:hover {
  border-color: var(--sage-light); background: rgba(122,158,126,.04);
  transform: translateX(4px);
}
.demo-icon { font-size: 1.5rem; }
.block-demo-item strong { display: block; font-size: .92rem; color: var(--text); }
.block-demo-item span { font-size: .78rem; color: var(--text-muted); }

/* --- Frameworks --- */
.block-frameworks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fw-card {
  padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--light-gray); text-align: center;
  transition: var(--transition);
}
.fw-card:hover { border-color: var(--sage-light); background: rgba(122,158,126,.04); }
.fw-emoji { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.fw-card strong { font-size: .85rem; color: var(--text); display: block; margin-bottom: 2px; }
.fw-card span { font-size: .75rem; color: var(--text-muted); }

/* --- Manifesto --- */
.manifesto { text-align: center; }
.manifesto h2 { font-size: 1.1rem; margin-bottom: 16px; color: var(--text); }
.manifesto blockquote {
  font-size: 1.1rem; color: var(--sage-dark); font-weight: 500;
  font-style: italic; border: none; padding: 0; margin: 0 0 12px;
  line-height: 1.8;
}
.manifesto p { font-size: .9rem; color: var(--text-light); }

/* ================================================================
   DEMOS PAGE
   ================================================================ */
.demos-hero {
  text-align: center; padding: 56px 24px 40px;
}
.demos-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; }
.demos-hero p { font-size: .95rem; color: var(--text-light); }

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-bottom: 64px;
}
.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: block;
}
.demo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
  border-color: var(--sage-light);
}
.demo-card-large { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }

.demo-preview {
  background: linear-gradient(135deg, #2D3A2E, #1a2420);
  min-height: 220px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.demo-preview-sm { min-height: 160px; }
.demo-orbit { position: relative; width: 160px; height: 160px; }
.demo-sun {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 28px; height: 28px; background: #FFD93D; border-radius: 50%;
  box-shadow: 0 0 20px rgba(255,217,61,.5);
}
.demo-planet {
  position: absolute; border-radius: 50%;
  animation: orbit-spin linear infinite;
}
.demo-planet.p1 { width:10px; height:10px; background:#4A9FE5; top:10%; left:45%; animation-duration:4s; }
.demo-planet.p2 { width:14px; height:14px; background:#E5734A; top:65%; left:75%; animation-duration:7s; }
.demo-planet.p3 { width:8px; height:8px; background:#A0D468; top:80%; left:25%; animation-duration:10s; }
@keyframes orbit-spin {
  0% { transform: rotate(0deg) translateX(50px) rotate(0deg); }
  100% { transform: rotate(360deg) translateX(50px) rotate(-360deg); }
}
.demo-sun-mini { width: 40px; height: 40px; background: #FFD93D; border-radius: 50%; box-shadow: 0 0 16px rgba(255,217,61,.4); }
.demo-earth-tile { width: 24px; height: 24px; background: #4A9FE5; border-radius: 50%; margin-top: 20px; }
.demo-beaker { font-size: 2rem; position: relative; }
.demo-liquid { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); width: 20px; height: 12px; background: rgba(100,200,255,.3); border-radius: 0 0 4px 4px; }
.demo-tool-icon { font-size: 2.5rem; }

.demo-info { padding: 24px; }
.demo-tag {
  font-size: .72rem; padding: 3px 10px; border-radius: 12px;
  background: rgba(122,158,126,.1); color: var(--sage-dark);
  display: inline-block; margin-bottom: 10px; font-weight: 500;
}
.demo-info h2 { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }
.demo-info p { font-size: .88rem; color: var(--text-light); line-height: 1.7; }

/* ================================================================
   ARTICLE / SINGLE PAGE
   ================================================================ */
.article { max-width: 740px; margin: 0 auto; padding: 48px 24px; }
.article-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.article-header h1 { font-size: 1.8rem; margin-bottom: 12px; line-height: 1.4; }
.article-meta { display: flex; gap: 10px; align-items: center; }
.article-meta time { font-size: .82rem; color: var(--warm-gray); }
.post-cat {
  font-size: .72rem; background: rgba(122,158,126,.1); color: var(--sage-dark);
  padding: 2px 10px; border-radius: 12px; font-weight: 500;
}

.article-content { font-size: 1rem; line-height: 1.9; }
.article-content h2 {
  font-size: 1.35rem; margin: 36px 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--sage-lighter); color: var(--text);
}
.article-content h3 { font-size: 1.1rem; margin: 28px 0 12px; color: var(--sage-dark); }
.article-content h4 { font-size: 1rem; margin: 20px 0 8px; color: var(--text); }
.article-content p { margin: 12px 0; }
.article-content ul, .article-content ol { margin: 12px 0; padding-left: 24px; }
.article-content li { margin: 4px 0; }
.article-content pre {
  background: #2B2B2B; color: #D4D4D4; padding: 20px; border-radius: var(--radius-sm);
  overflow-x: auto; margin: 16px 0; font-size: .85rem; line-height: 1.65;
  border: 1px solid #3A3A3A;
}
.article-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: .88em;
}
.article-content :not(pre) > code {
  background: var(--light-gray); padding: 2px 6px; border-radius: 4px;
  color: var(--sage-dark);
}
.article-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 16px 0; }
.article-content blockquote {
  border-left: 3px solid var(--sage); background: var(--bg-white);
  padding: 14px 20px; margin: 16px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-light);
}
.article-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .92rem; }
.article-content th, .article-content td {
  padding: 10px 14px; border: 1px solid var(--border); text-align: left;
}
.article-content th { background: var(--bg-white); font-weight: 600; color: var(--text); }
.article-content hr { border: none; border-top: 1px solid var(--light-gray); margin: 24px 0; }

/* Series Nav */
.series-nav {
  margin-top: 40px; padding: 24px; background: var(--bg-white);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.series-nav h3 { margin-bottom: 12px; font-size: .95rem; color: var(--sage-dark); }
.series-nav a { display: block; padding: 6px 0; color: var(--text-light); font-size: .9rem; }
.series-nav a:hover { color: var(--sage-dark); }
.series-nav a.current { color: var(--sage-dark); font-weight: 600; }

.article-footer { margin-top: 32px; }
.article-footer a { color: var(--sage); font-size: .9rem; }
.article-footer a:hover { color: var(--sage-dark); }

/* ================================================================
   LIST PAGE (Posts)
   ================================================================ */
.page-title {
  font-size: 1.6rem; margin: 48px 0 24px; padding-bottom: 14px;
  border-bottom: 2px solid var(--sage-lighter);
}
.post-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 64px; }
.post-item {
  padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); transition: var(--transition);
}
.post-item:hover {
  border-color: var(--sage-light); box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}
.post-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.post-meta time { font-size: .82rem; color: var(--warm-gray); }
.post-item h3 { font-size: 1.1rem; margin-bottom: 6px; }
.post-item h3 a { color: var(--text); }
.post-item h3 a:hover { color: var(--sage-dark); }
.post-item > p { font-size: .88rem; color: var(--text-light); margin: 0; }

.btn-more {
  display: inline-block; margin-top: 24px; padding: 10px 28px;
  background: var(--sage); color: #fff; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .9rem; transition: var(--transition);
}
.btn-more:hover { background: var(--sage-dark); color: #fff; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  background: var(--text); color: #bbb; margin-top: 0; padding: 48px 0 24px;
}
.footer-content { display: flex; gap: 64px; margin-bottom: 32px; }
.footer-manifesto { flex: 2; }
.footer-links { flex: 1; }
.footer-content h3 { color: var(--sage-light); margin-bottom: 12px; font-size: .95rem; font-weight: 600; }
.footer-desc { margin-top: 8px; font-size: .85rem; color: #888; line-height: 1.7; }
.footer-links a { display: block; color: #999; margin-bottom: 8px; font-size: .88rem; }
.footer-links a:hover { color: var(--sage-light); }
.footer-bottom {
  border-top: 1px solid #555; padding-top: 20px; text-align: center;
  font-size: .82rem; color: #666;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg-white); flex-direction: column; padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
  .main-nav.open { display: flex; }

  .home-hero { padding: 56px 20px 40px; }
  .hero-title { font-size: 1.6rem; }
  .home-grid { grid-template-columns: 1fr; }
  .home-block-wide { grid-column: auto; }
  .block-posts { grid-template-columns: 1fr; }
  .block-frameworks { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-card-large { grid-template-columns: 1fr; }
  .footer-content { flex-direction: column; gap: 32px; }
}

/* ================================================================
   POSTS PAGE - 分类目录索引
   ================================================================ */
.posts-page-header {
  text-align: center;
  padding: 48px 24px 32px;
}
.posts-page-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.posts-page-header p { font-size: .92rem; color: var(--text-light); }

.cat-section {
  max-width: 800px;
  margin: 0 auto 32px;
  padding: 0 24px;
}
.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--sage-lighter);
}
.cat-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.cat-count {
  font-size: .8rem;
  color: var(--text-muted);
  background: var(--light-gray);
  padding: 2px 12px;
  border-radius: 12px;
}
.cat-posts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cat-post-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.cat-post-link:hover {
  background: rgba(122,158,126,.06);
  transform: translateX(4px);
}
.cat-post-title {
  font-size: .92rem;
  color: var(--text);
  font-weight: 500;
}
.cat-post-link:hover .cat-post-title { color: var(--sage-dark); }
.cat-post-arrow {
  color: var(--light-gray);
  font-size: .9rem;
  transition: var(--transition);
}
.cat-post-link:hover .cat-post-arrow { color: var(--sage); }
