/* Blog Styles - matches youragent dark theme */
:root {
  --bg: #0a0a0f;
  --bg-card: rgba(255,255,255,.04);
  --text: rgba(255,255,255,.92);
  --text-muted: rgba(255,255,255,.55);
  --text-dim: rgba(255,255,255,.3);
  --border: rgba(255,255,255,.08);
  --border-hover: rgba(255,255,255,.15);
  --purple: #7c3aed;
  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --radius: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased; line-height: 1.7;
}

/* Nav */
.blog-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10,10,15,.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border); padding: 0 24px;
}
.blog-nav-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.blog-nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text); font-weight: 700; font-size: 16px;
}
.blog-nav-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.blog-nav-links { display: flex; gap: 16px; align-items: center; }
.blog-nav-links a {
  color: var(--text-muted); text-decoration: none; font-size: 14px; transition: color .2s;
}
.blog-nav-links a:hover { color: var(--text); }

/* Language Toggle */
.blog-lang-btn {
  padding: 5px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: rgba(124,58,237,.15); color: #a78bfa; border: 1px solid rgba(124,58,237,.25);
  cursor: pointer; transition: all .2s; margin-left: 4px;
}
.blog-lang-btn:hover { background: rgba(124,58,237,.25); }

/* i18n: hide/show based on language */
[lang="en"] { display: none; }
html[data-lang="en"] [lang="en"] { display: block; }
html[data-lang="en"] [lang="zh"] { display: none; }
html[data-lang="en"] .blog-card[lang="en"] { display: block; }
html[data-lang="en"] .blog-card[lang="zh"] { display: none; }
html[data-lang="zh"] .blog-card[lang="en"],
html:not([data-lang]) .blog-card[lang="en"] { display: none; }

/* Container */
.blog-container { max-width: 800px; margin: 0 auto; padding: 80px 24px 60px; }

/* Article Header */
.article-header { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.article-tag {
  padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
  background: rgba(124,58,237,.12); color: #a78bfa; border: 1px solid rgba(124,58,237,.2);
}
.article-title {
  font-size: clamp(28px, 5vw, 40px); font-weight: 800; line-height: 1.2;
  letter-spacing: -.02em; margin-bottom: 16px;
  background: linear-gradient(135deg, #fff, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.article-meta { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--text-muted); }
.article-meta svg { width: 16px; height: 16px; }

/* Article Body */
.article-body h2 {
  font-size: 24px; font-weight: 700; margin: 48px 0 16px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); color: #fff;
}
.article-body h3 { font-size: 18px; font-weight: 600; margin: 32px 0 12px; color: rgba(255,255,255,.9); }
.article-body h4 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: rgba(255,255,255,.85); }
.article-body p { margin-bottom: 16px; color: rgba(255,255,255,.78); line-height: 1.8; }
.article-body strong { color: #fff; }
.article-body a {
  color: var(--blue); text-decoration: none; border-bottom: 1px solid rgba(10,132,255,.3); transition: border-color .2s;
}
.article-body a:hover { border-color: var(--blue); }
.article-body ul, .article-body ol { margin-bottom: 16px; padding-left: 24px; color: rgba(255,255,255,.78); }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
  margin: 16px 0; padding: 16px 20px; border-left: 3px solid var(--purple);
  background: rgba(124,58,237,.06); border-radius: 0 var(--radius) var(--radius) 0;
  color: rgba(255,255,255,.7); font-style: italic;
}
.article-body hr { border: none; height: 1px; margin: 40px 0; background: linear-gradient(90deg, transparent, var(--border), transparent); }

/* Code */
.article-body code {
  background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 6px;
  font-family: var(--mono); font-size: 14px; color: #e9d5ff;
}
.article-body pre {
  margin: 16px 0 24px; padding: 20px; background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto;
}
.article-body pre code { background: none; padding: 0; font-size: 13px; color: rgba(255,255,255,.8); line-height: 1.6; }

/* Tables */
.article-body table { width: 100%; margin: 16px 0 24px; border-collapse: collapse; }
.article-body th {
  padding: 12px 16px; text-align: left; background: rgba(124,58,237,.1);
  border: 1px solid var(--border); font-weight: 600; font-size: 14px; color: #a78bfa;
}
.article-body td { padding: 10px 16px; border: 1px solid var(--border); font-size: 14px; color: rgba(255,255,255,.7); }
.article-body tr:hover td { background: rgba(255,255,255,.02); }

/* TL;DR */
.tldr {
  margin: 0 0 32px; padding: 20px 24px;
  background: linear-gradient(135deg, rgba(48,209,88,.06), rgba(10,132,255,.06));
  border: 1px solid rgba(48,209,88,.2); border-radius: var(--radius);
}
.tldr-title { font-size: 14px; font-weight: 700; color: var(--green); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .05em; }
.tldr ul { padding-left: 20px; }
.tldr li { color: rgba(255,255,255,.8); margin-bottom: 6px; font-size: 14px; }

/* CTA */
.article-cta {
  margin: 48px 0; padding: 32px;
  background: linear-gradient(135deg, rgba(124,58,237,.1), rgba(10,132,255,.08));
  border: 1px solid rgba(124,58,237,.2); border-radius: var(--radius); text-align: center;
}
.article-cta h3 { font-size: 20px; margin-bottom: 12px; color: #fff; }
.article-cta p { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.article-cta .btn {
  display: inline-block; padding: 12px 28px;
  background: linear-gradient(135deg, var(--purple), #6d28d9);
  color: #fff; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 15px;
  transition: transform .2s, box-shadow .2s; border: none; cursor: pointer;
}
.article-cta .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,.3); }

/* Footer */
.blog-footer {
  max-width: 800px; margin: 0 auto; padding: 24px;
  border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-dim);
}
.blog-footer a { color: var(--text-muted); text-decoration: none; }

/* Blog Index Cards */
.blog-hero { text-align: center; margin-bottom: 48px; }
.blog-hero h1 {
  font-size: clamp(32px, 5vw, 48px); font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 12px;
}
.blog-hero p { font-size: 16px; color: var(--text-muted); }
.blog-grid { display: flex; flex-direction: column; gap: 20px; }
.blog-card {
  display: block; text-decoration: none; padding: 28px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: all .3s;
}
.blog-card:hover {
  border-color: var(--border-hover); background: rgba(255,255,255,.06);
  transform: translateY(-2px); box-shadow: 0 8px 32px rgba(124,58,237,.08);
}
.blog-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.blog-card-tag { padding: 3px 10px; border-radius: 16px; font-size: 11px; font-weight: 500; background: rgba(124,58,237,.1); color: #a78bfa; }
.blog-card h2 { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 8px; line-height: 1.3; }
.blog-card p { font-size: 14px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.blog-card-meta { font-size: 13px; color: var(--text-dim); }

@media (max-width: 640px) {
  .blog-container { padding: 72px 16px 40px; }
  .article-body pre { padding: 14px; }
  .article-body table { font-size: 13px; }
  .article-body th, .article-body td { padding: 8px 10px; }
  .blog-nav-links { gap: 10px; }
  .blog-nav-links a { font-size: 13px; }
}
