/* ============================================
   DRGTECH — Design System Clean & Light
   Inspirado em UI moderna, arejada e minimalista
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,800;1,600;1,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Variables ─── */
:root {
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F8FAFC;
  --bg-card:       #FFFFFF;
  --bg-subtle:     #F1F5F9;
  --bg-muted:      #E9EEF5;

  --primary:       #2563EB;
  --primary-light: #EFF6FF;
  --primary-mid:   #BFDBFE;
  --primary-hover: #1D4ED8;

  --accent:        #0EA5E9;
  --accent-light:  #F0F9FF;

  --success:       #059669;
  --success-light: #ECFDF5;
  --warning:       #D97706;
  --warning-light: #FFFBEB;
  --danger:        #DC2626;
  --danger-light:  #FEF2F2;

  --text-primary:   #0F172A;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;
  --text-on-dark:   #FFFFFF;

  --border:         #E2E8F0;
  --border-focus:   #93C5FD;
  --border-strong:  #CBD5E1;

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 48px rgba(0,0,0,0.12);

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-full:50px;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --transition:      all 0.2s ease;
  --transition-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width:     1180px;
  --article-width: 740px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Reading Progress Bar ─── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-text span {
  color: var(--primary);
}

.logo-tagline {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  display: block;
  margin-top: -3px;
}

.header-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: var(--transition);
  outline: none;
}

.header-search input:focus {
  border-color: var(--border-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
}

.header-search input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.3rem;
  padding: 4px;
}

/* ─── Mobile Nav ─── */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { padding: 10px 12px; }

/* ─── Hero ─── */
.hero {
  padding: 48px 24px 40px;
  text-align: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  border: 1.5px solid var(--primary-mid);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 28px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: italic;
  color: var(--primary);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 44px;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 32px;
  max-width: 440px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.stat {
  text-align: center;
  flex: 1;
  position: relative;
}

.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--border-strong);
}

.stat-num {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ─── Category Filter ─── */
.category-bar {
  padding: 0 24px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  background: var(--bg-primary);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.cat-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* ─── Section Divider ─── */
.section-divider {
  height: 1px;
  background: var(--border);
  max-width: var(--max-width);
  margin: 0 auto 40px;
}

/* ─── Articles Section ─── */
.articles-section {
  padding: 0 24px 80px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-title em {
  font-style: italic;
  color: var(--primary);
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ─── Article Card ─── */
.article-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-mid);
  box-shadow: var(--shadow-lg);
}

.card-icon-area {
  padding: 24px 24px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.card-meta { flex: 1; display: flex; align-items: center; }

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.cat-windows   { background: #EFF6FF; color: #1D4ED8; }
.cat-wifi      { background: #F5F3FF; color: #6D28D9; }
.cat-android   { background: #ECFDF5; color: #047857; }
.cat-bateria   { background: #FFFBEB; color: #B45309; }
.cat-seguranca { background: #FEF2F2; color: #B91C1C; }

.icon-blue   { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.icon-purple { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }
.icon-green  { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.icon-orange { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.icon-red    { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

.card-body {
  padding: 0 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 10px;
  transition: var(--transition);
}

.article-card:hover .card-title { color: var(--primary); }

.card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 20px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.read-more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.article-card:hover .read-more { gap: 8px; }

/* ─── No Results ─── */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: none;
}

.no-results .nr-icon { font-size: 2.5rem; margin-bottom: 12px; }
.no-results p { font-size: 0.95rem; }

/* ─── Article Page Layout ─── */
.article-page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 248px;
  gap: 52px;
  align-items: start;
}

/* ─── Breadcrumbs ─── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { color: var(--text-secondary); font-weight: 500; }
.breadcrumb-sep { opacity: 0.5; }

/* ─── Article Header ─── */
.article-header { margin-bottom: 32px; }

.article-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.badge-blue     { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-purple   { background: #F5F3FF; color: #6D28D9; border: 1px solid #DDD6FE; }
.badge-green    { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.badge-orange   { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; }
.badge-red      { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }

.article-h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.article-intro-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1.5px solid var(--border);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.diff-easy { background: var(--success-light); color: var(--success); }

/* ─── Article Content ─── */
.article-content { max-width: var(--article-width); }

.article-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 36px;
  padding: 20px 24px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
}

/* ─── Body Typography ─── */
.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 44px 0 18px;
  padding-top: 16px;
  border-top: 1.5px solid var(--border);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 30px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.method-badge {
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.article-body p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.96rem;
  line-height: 1.8;
}

.article-body strong { color: var(--text-primary); font-weight: 600; }

.article-body ol {
  margin: 14px 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-body ol li {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
  padding-left: 6px;
}

.article-body ul {
  margin: 12px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.article-body ul li {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.7;
  padding-left: 20px;
  position: relative;
}

.article-body ul li::before {
  content: '›';
  position: absolute;
  left: 6px;
  color: var(--primary);
  font-weight: 700;
}

/* ─── Image Placeholder ─── */
.img-placeholder {
  background: var(--bg-subtle);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  margin: 22px 0;
  cursor: pointer;
  transition: var(--transition);
}

.img-placeholder:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.img-placeholder .placeholder-icon { font-size: 2rem; margin-bottom: 8px; }

.img-placeholder p {
  color: var(--text-muted) !important;
  font-size: 0.82rem !important;
  margin: 0 !important;
}

.img-placeholder strong {
  color: var(--primary) !important;
  display: block;
  font-size: 0.875rem;
  margin-bottom: 4px;
}

/* ─── Info Boxes ─── */
.info-box, .warning-box, .tip-box, .success-box {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 18px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1.5px solid;
}

.info-box    { background: var(--primary-light); border-color: var(--primary-mid); }
.warning-box { background: var(--warning-light); border-color: #FCD34D; }
.tip-box     { background: var(--accent-light);  border-color: #BAE6FD; }
.success-box { background: var(--success-light); border-color: #A7F3D0; }

.box-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.box-content { flex: 1; }

.box-content p {
  margin: 0 !important;
  font-size: 0.875rem !important;
  line-height: 1.65 !important;
}

.info-box    .box-content p { color: #1E40AF !important; }
.warning-box .box-content p { color: #92400E !important; }
.tip-box     .box-content p { color: #0369A1 !important; }
.success-box .box-content p { color: #065F46 !important; }

/* ─── Command Box ─── */
.cmd-box {
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  margin: 18px 0;
  overflow: hidden;
}

.cmd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.cmd-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.cmd-label::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
}

.copy-btn {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  transition: var(--transition);
}

.copy-btn:hover { color: var(--primary); border-color: var(--primary); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

.cmd-code {
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #1E3A5F;
  line-height: 1.6;
  overflow-x: auto;
}

/* ─── Steps List ─── */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
  list-style: none !important;
}

.steps-list li {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: var(--bg-card) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  transition: var(--transition);
  padding-left: 16px !important;
}

.steps-list li:hover {
  border-color: var(--primary-mid) !important;
  background: var(--primary-light) !important;
}

.steps-list li::before { display: none !important; }

.step-num {
  width: 26px;
  height: 26px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
  font-size: 0.935rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.step-text strong { color: var(--text-primary); }

/* ─── FAQ Accordion ─── */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }

.faq-item {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.open { border-color: var(--primary-mid); }

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 18px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.935rem;
  font-weight: 600;
  transition: var(--transition);
}

.faq-question:hover { color: var(--primary); }

.faq-icon {
  width: 22px;
  height: 22px;
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
}

.faq-item.open .faq-answer { max-height: 400px; }

.faq-answer-inner {
  padding: 0 18px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

/* ─── Related Articles ─── */
.related-articles {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1.5px solid var(--border);
}

.related-articles h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
  border: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.related-card {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

.related-card:hover {
  border-color: var(--primary-mid);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.related-card-icon { font-size: 1.3rem; }

.related-card-title {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

/* ─── TOC Sidebar ─── */
.toc-sidebar {
  position: sticky;
  top: 84px;
}

.toc-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.toc-list li a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: var(--transition);
  line-height: 1.45;
}

.toc-list li a:hover,
.toc-list li a.active {
  color: var(--primary);
  background: var(--primary-light);
  border-left-color: var(--primary);
}

.toc-list li.toc-h3 a {
  padding-left: 18px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 32px 0;
}

/* ─── kbd ─── */
kbd {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text-primary);
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1.5px solid var(--border);
  padding: 52px 24px 32px;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 280px;
  line-height: 1.65;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}
.footer-col ul li a:hover { color: var(--primary); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p { font-size: 0.82rem; color: var(--text-muted); }
.footer-bottom a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* ─── Scroll to Top ─── */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  z-index: 500;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#scroll-top:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* ─── Animations ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .article-page-wrapper { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header-search { display: none; }
  .header-nav { display: none; }
  .hamburger { display: flex; }
  .hero { padding: 56px 20px 44px; }
  .hero-stats { padding: 16px 24px; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand p { max-width: 100%; }
  .article-page-wrapper { padding: 20px 16px 60px; }
  .article-h1 { font-size: 1.65rem; }
}
