:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --primary: #e11d48;
  --primary-dark: #be123c;
  --primary-soft: #fde8ef;
  --border: #e5e7eb;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.site-brand { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.site-brand:hover { text-decoration: none; color: var(--primary); }
.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a { color: var(--text); font-weight: 600; }
.site-nav a:hover { color: var(--primary); text-decoration: none; }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
}

/* Hero */
.hero { background: linear-gradient(135deg, #e11d48 0%, #be123c 100%); color: #fff; padding: 56px 0; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 4vw, 3rem); }
.hero-subtitle { margin: 0; opacity: .95; font-size: 1.1rem; max-width: 720px; }
.hero-text { margin-top: 16px; }
.hero-text p { margin: 0 0 10px; }
.hero-text a { color: #fff; text-decoration: underline; }

/* Sections */
.section { padding: 40px 0; }
.section-title { font-size: 1.5rem; margin: 0 0 20px; }

/* Cards grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0, 0, 0, .1); }
.card-link { display: block; color: inherit; height: 100%; }
.card-link:hover { text-decoration: none; }
.card-img { width: 100%; height: 180px; object-fit: cover; display: block; background: #eceef1; }
.card-body { padding: 16px 18px; }
.card-title { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.3; }
.card-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.card-desc { margin: 0; color: var(--muted); font-size: .92rem; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.category-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.category-card:hover { text-decoration: none; border-color: var(--primary); }
.category-name { font-weight: 700; }
.category-count { color: var(--muted); font-size: .85rem; white-space: nowrap; }

/* Page header */
.page-header { padding: 32px 0 8px; }
.page-header h1 { margin: 0 0 8px; font-size: 2rem; }
.page-count { color: var(--muted); margin: 0 0 16px; }
.page-desc { color: var(--muted); }

/* Post */
.post { padding: 24px 0 56px; }
.breadcrumbs {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumbs .sep { color: var(--muted); }
.post-header h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); line-height: 1.2; margin: 0 0 12px; }
.post-meta { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.meta-label { font-weight: 600; }
.post-description { font-size: 1.1rem; color: #374151; margin: 0 0 20px; }
.post-featured { margin: 20px 0; }
.post-featured img { width: 100%; height: auto; border-radius: var(--radius); display: block; }

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}
.toc-title { font-weight: 800; margin: 0 0 8px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--text); }

/* Content */
.post-content { font-size: 1.05rem; }
.post-content h2 { margin-top: 2rem; }
.post-content h3 { margin-top: 1.5rem; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.2rem 0;
  padding: .4rem 1rem;
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
}
.post-content code { background: #eceef1; padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* FAQ */
.faq { margin-top: 40px; }
.faq h2 { margin-bottom: 16px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--primary);
}
.faq-item[open] summary::after { content: "–"; }
.faq-answer { padding: 0 20px 18px; color: #374151; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 10px;
  margin: 4px;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 32px 0; }
.page-link {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
}
.page-link:hover { text-decoration: none; border-color: var(--primary); }
.page-info { color: var(--muted); }

/* Not found */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h1 { font-size: clamp(3rem, 10vw, 6rem); margin: 0; color: var(--primary); }
.not-found-lead { font-size: 1.2rem; color: #374151; margin: 12px 0; }
.not-found-actions { margin-top: 20px; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  margin-top: 40px;
}

/* More link */
.more-link { margin-top: 24px; text-align: center; }
.more-link a { font-weight: 700; }

/* Responsive */
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .header-inner { flex-wrap: wrap; }
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    padding: 8px 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; border-top: 1px solid var(--border); }
}

