:root {
  --bg: #fafafa;
  --text: #111;
  --text-secondary: #555;
  --border: #e0e0e0;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --ad-bg: #f3f4f6;
  --max-width: 1200px;
  --content-width: 740px;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-body: 'Merriweather', Georgia, serif;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --border: #374151;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --ad-bg: #1f2937;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.7; transition: background 0.3s, color 0.3s; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.logo { font-family: var(--font-ui); font-weight: 700; font-size: 1.4rem; color: var(--text); }
.main-nav ul { display: flex; gap: 1.5rem; }
.main-nav a { font-family: var(--font-ui); font-weight: 500; font-size: 0.95rem; color: var(--text-secondary); }
.main-nav a.active, .main-nav a:hover { color: var(--accent); }

.menu-toggle, .theme-toggle { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); padding: 0.5rem; }
.menu-toggle { display: none; }

/* Progress Bar */
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0%; z-index: 999; transition: width 0.1s; }

/* Ad Slots */
.ad-slot { background: var(--ad-bg); border: 1px dashed var(--border); border-radius: 8px; padding: 1rem; text-align: center; margin: 1.5rem 0; position: relative; min-height: 60px; display: flex; align-items: center; justify-content: center; }
.ad-label { position: absolute; top: -10px; left: 10px; background: var(--border); color: var(--text-secondary); font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-family: var(--font-ui); }
.ad-header { max-width: 728px; margin: 1rem auto; }
.ad-in-article { margin: 2rem 0; }
.ad-sidebar.sticky { position: sticky; top: 2rem; }
.ad-mobile-bottom { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); border-top: 1px solid var(--border); padding: 0.5rem; display: none; z-index: 100; justify-content: center; }
.close-ad { position: absolute; top: 5px; right: 5px; background: var(--border); border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; color: var(--text-secondary); }

/* Homepage */
.featured-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; background: var(--ad-bg); border-radius: 12px; overflow: hidden; margin: 2rem 0; }
.featured-card img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 1.5rem; }
.section-title { font-family: var(--font-ui); font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.card { background: var(--ad-bg); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.card img { width: 100%; height: 160px; object-fit: cover; }
.tag { display: inline-block; font-family: var(--font-ui); font-size: 0.75rem; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 20px; margin-bottom: 0.5rem; }
.card h2, .card h3 { font-family: var(--font-ui); margin: 0.5rem 0; line-height: 1.3; }
.meta { font-size: 0.85rem; color: var(--text-secondary); font-family: var(--font-ui); }

/* Article Page */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; margin-top: 2rem; }
.article-content { max-width: var(--content-width); }
.breadcrumb { font-family: var(--font-ui); font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 1rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.2; margin: 0.5rem 0 1rem; }
.featured-img { border-radius: 8px; margin: 1.5rem 0; }
.article-body p { margin-bottom: 1.5rem; }
.article-body h2 { font-family: var(--font-ui); font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.share-bar { display: flex; gap: 0.8rem; margin: 2rem 0; }
.share-btn { font-family: var(--font-ui); padding: 0.6rem 1rem; background: var(--ad-bg); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; color: var(--text); }
.share-btn:hover { background: var(--border); }

.sidebar-widget h3 { font-family: var(--font-ui); font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--accent); }
.sidebar-widget li { margin-bottom: 0.8rem; }
.sidebar-widget a { font-family: var(--font-ui); font-size: 0.95rem; }

.site-footer { background: var(--ad-bg); border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 4rem; font-family: var(--font-ui); font-size: 0.9rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 1rem; }
  .main-nav.active { display: block; }
  .menu-toggle { display: block; }
  .featured-card { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .ad-sidebar.sticky { position: static; }
  .ad-mobile-bottom { display: flex; }
  .share-btn { flex: 1; font-size: 0.85rem; }
}