/* ============================================================
   大树说道 - 博客主题 v2.0
   设计原则：干净、可读、文章优先
   ============================================================ */

/* CSS Variables */
:root {
  /* 主色调 */
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;

  /* 文字 */
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;

  /* 背景 */
  --bg: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-card: #ffffff;
  --bg-hover: #f3f4f6;

  /* 边框 */
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* 系列色 */
  --color-toolkit: #2563eb;
  --color-garden: #d97706;
  --color-agent: #7c3aed;
  --color-token: #059669;

  /* 尺寸 */
  --max-width: 1080px;
  --header-height: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-light: #6b7280;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --border: #334155;
    --border-light: #1e293b;
  }
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.95);
}
@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(15, 23, 42, 0.95);
  }
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.site-logo:hover {
  color: var(--primary);
}
.site-logo .emoji {
  font-size: 26px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
  background: var(--primary-light);
}
@media (prefers-color-scheme: dark) {
  .site-nav a:hover,
  .site-nav a.active {
    background: rgba(26, 115, 232, 0.15);
  }
}

/* ============================================================
   Main Content
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.hero .tagline {
  font-size: 15px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 公众号引流 */
.hero-cta {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-cta .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.hero-cta .btn-primary {
  background: var(--primary);
  color: white;
}
.hero-cta .btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.hero-cta .btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.hero-cta .btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================================
   Series Nav
   ============================================================ */
.series-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.series-tag {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: var(--bg);
}
.series-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
@media (prefers-color-scheme: dark) {
  .series-tag:hover {
    background: rgba(26, 115, 232, 0.1);
  }
}

.series-tag.token {
  border-color: var(--color-token);
  color: var(--color-token);
}
.series-tag.token:hover {
  background: rgba(5, 150, 105, 0.1);
}

/* ============================================================
   Article List
   ============================================================ */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}
.article-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-light);
}

.article-card .card-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-card .card-category {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.article-card .card-category.toolkit { background: #dbeafe; color: #1d4ed8; }
.article-card .card-category.garden { background: #fef3c7; color: #b45309; }
.article-card .card-category.agent { background: #ede9fe; color: #7c3aed; }
.article-card .card-category.token { background: #d1fae5; color: #047857; }

@media (prefers-color-scheme: dark) {
  .article-card .card-category.toolkit { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
  .article-card .card-category.garden { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }
  .article-card .card-category.agent { background: rgba(124, 58, 237, 0.2); color: #c4b5fd; }
  .article-card .card-category.token { background: rgba(5, 150, 105, 0.2); color: #6ee7b7; }
}

.article-card h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.article-card h2 a {
  color: var(--text);
}
.article-card h2 a:hover {
  color: var(--primary);
}

.article-card .card-summary {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.article-card .card-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   Article Detail
   ============================================================ */
.article-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0;
}

.article-detail-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.article-detail-header .detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-detail-header h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 16px;
}

.article-detail-header .detail-summary {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.article-detail-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
}

.article-detail-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.article-detail-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.article-detail-body p {
  margin-bottom: 16px;
}

.article-detail-body ul,
.article-detail-body ol {
  margin: 12px 0 16px 24px;
}

.article-detail-body li {
  margin-bottom: 8px;
}

.article-detail-body blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.article-detail-body pre {
  margin: 20px 0;
  padding: 16px 20px;
  background: #1e293b;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
  color: #e2e8f0;
}

.article-detail-body code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9em;
}

.article-detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
}

.article-detail-body th,
.article-detail-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.article-detail-body th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.article-detail-body img {
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

/* ============================================================
   Sidebar / 公众号引流
   ============================================================ */
.sidebar-section {
  margin-top: 40px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.sidebar-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sidebar-section p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.qr-code {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
  display: block;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 40px 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  margin-top: 60px;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-light);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-text {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 28px;
  }
  
  .article-detail-header h1 {
    font-size: 24px;
  }
  
  .site-nav {
    gap: 4px;
  }
  
  .site-nav a {
    padding: 6px 10px;
    font-size: 13px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .container {
    padding: 0 16px;
  }

  .article-card {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .site-nav a.nav-hide-mobile {
    display: none;
  }
}
