:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-card: #222633;
  --bg-card-hover: #2a2f3e;
  --text-primary: #e8eaed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --accent-light: rgba(245,158,11,0.12);
  --accent-glow: rgba(245,158,11,0.25);
  --border: #2d3348;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1140px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Cascadia Code', 'Consolas', monospace;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
}

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

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }

/* ===== NAV ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-brand {
  font-size: 1.25rem; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px;
}
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: .9rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.nav-hamburger { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.5rem; cursor: pointer; }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1c1f2e 50%, var(--bg-secondary) 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, var(--accent-glow) 0%, transparent 50%);
  opacity: 0.4;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 16px; line-height: 1.2; }
.hero h1 .accent { color: var(--accent); }
.hero p { color: var(--text-secondary); font-size: 1.1rem; margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

.btn-primary {
  display: inline-block; padding: 14px 36px; background: var(--accent); color: #000;
  font-weight: 700; font-size: 1rem; border-radius: var(--radius); border: none; cursor: pointer;
  transition: all .2s; text-transform: none;
}
.btn-primary:hover { background: var(--accent-hover); color: #000; transform: translateY(-1px); box-shadow: 0 4px 20px var(--accent-glow); }
.btn-secondary {
  display: inline-block; padding: 12px 28px; background: transparent; color: var(--accent);
  font-weight: 600; border: 2px solid var(--accent); border-radius: var(--radius); cursor: pointer;
  transition: all .2s; margin-left: 12px;
}
.btn-secondary:hover { background: var(--accent-light); }

/* ===== SECTIONS ===== */
.section { padding: 60px 24px; max-width: var(--max-width); margin: 0 auto; }
.section-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 12px; text-align: center; }
.section-title .accent { color: var(--accent); }
.section-desc { color: var(--text-secondary); text-align: center; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ===== FEATURES ===== */
.features-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: all .3s;
}
.feature-card:hover { border-color: var(--accent); background: var(--bg-card-hover); transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--text-primary); }
.feature-card p { color: var(--text-secondary); font-size: .92rem; }

/* ===== DOWNLOAD CARDS ===== */
.download-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.download-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; transition: all .3s;
}
.download-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.download-card .icon { font-size: 2.5rem; margin-bottom: 12px; }
.download-card h3 { margin-bottom: 6px; }
.download-card p { color: var(--text-secondary); font-size: .85rem; margin-bottom: 16px; }

/* ===== ARTICLE CARDS ===== */
.articles-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px;
}
.article-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all .3s;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-card img { width: 100%; height: 180px; object-fit: cover; }
.article-card-body { padding: 20px; }
.article-card .tag {
  display: inline-block; background: var(--accent-light); color: var(--accent);
  font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
}
.article-card h3 { font-size: 1.05rem; margin-bottom: 8px; line-height: 1.4; }
.article-card h3 a { color: var(--text-primary); }
.article-card h3 a:hover { color: var(--accent); }
.article-card .meta { color: var(--text-muted); font-size: .82rem; }

/* ===== ARTICLE PAGE ===== */
.article-page { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px; }
.article-page .breadcrumb { color: var(--text-muted); font-size: .85rem; margin-bottom: 20px; }
.article-page .breadcrumb a { color: var(--text-secondary); }

.article-header { margin-bottom: 32px; }
.article-header .tag { display: inline-block; background: var(--accent-light); color: var(--accent); font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; }
.article-header h1 { font-size: 2rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.article-header .meta { color: var(--text-muted); font-size: .88rem; }

.cpa-banner {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 20px 24px; margin-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.cpa-banner-text h3 { font-size: 1.1rem; margin-bottom: 4px; }
.cpa-banner-text p { color: var(--text-secondary); font-size: .88rem; }
.cpa-banner .btn-primary { white-space: nowrap; font-size: .9rem; padding: 10px 24px; }

.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; }

.article-body { min-width: 0; }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 36px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.article-body h3 { font-size: 1.15rem; font-weight: 600; margin: 24px 0 10px; }
.article-body p { margin-bottom: 16px; color: var(--text-secondary); }
.article-body ul, .article-body ol { margin: 12px 0 16px 24px; color: var(--text-secondary); }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  background: var(--accent-light); border-left: 4px solid var(--accent);
  padding: 14px 18px; margin: 20px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary); font-size: .93rem;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .9rem; }
.article-body th { background: var(--bg-card); color: var(--text-primary); padding: 10px 14px; text-align: left; border: 1px solid var(--border); font-weight: 600; }
.article-body td { padding: 10px 14px; border: 1px solid var(--border); color: var(--text-secondary); }
.article-body img { margin: 20px 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-body code { background: var(--bg-card); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .88rem; color: var(--accent); }
.article-body pre { background: var(--bg-card); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; margin: 16px 0; }
.article-body pre code { background: none; padding: 0; color: var(--text-secondary); }

/* Sidebar */
.sidebar {}
.sidebar-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px;
}
.sidebar-card h3 { font-size: 1rem; margin-bottom: 14px; color: var(--accent); }
.sidebar-card.download-card {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border-color: var(--accent);
  text-align: center;
}
.sidebar-card.download-card .btn-primary { display: block; width: 100%; text-align: center; margin-top: 12px; }
.sidebar-card ul { list-style: none; }
.sidebar-card li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-card li a { color: var(--text-secondary); }
.sidebar-card li a:hover { color: var(--accent); }

/* ===== FAQ ===== */
.faq-section { margin-top: 48px; }
.faq-section h2 { margin-bottom: 20px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; }
.faq-q { padding: 14px 18px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--bg-card); }
.faq-q::after { content: '+'; color: var(--accent); font-size: 1.2rem; }
.faq-q.active::after { content: '−'; }
.faq-a { padding: 0 18px; max-height: 0; overflow: hidden; transition: all .3s; color: var(--text-secondary); font-size: .93rem; }
.faq-a.open { padding: 14px 18px; max-height: 500px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 48px 24px 24px; margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-brand p { color: var(--text-muted); font-size: .88rem; margin-top: 8px; line-height: 1.6; }
.footer h4 { color: var(--text-primary); font-size: .95rem; margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 8px; }
.footer a { color: var(--text-muted); font-size: .88rem; }
.footer a:hover { color: var(--accent); }
.footer-bottom {
  max-width: var(--max-width); margin: 24px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border); text-align: center;
  color: var(--text-muted); font-size: .82rem;
}

/* ===== INDEX PAGES ===== */
.index-header { margin-bottom: 36px; }
.index-header h1 { font-size: 2rem; margin-bottom: 8px; }
.index-header p { color: var(--text-secondary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 16px;
  }
  .nav-hamburger { display: block; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: .95rem; }
  .btn-secondary { display: block; margin: 12px 0 0; }
  .features-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .cpa-banner { flex-direction: column; text-align: center; }
}
