:root {
  --bg: #0a0c0f;
  --surface: #111418;
  --border: #1e2530;
  --accent: #c8372d;
  --accent2: #e87722;
  --text: #d4d9e2;
  --muted: #5a6475;
  --card-bg: #13171d;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: 'Inter', 'Segoe UI', system-ui, sans-serif; line-height: 1.6; }
a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--accent); }

/* Header */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; border-bottom: 2px solid var(--accent);
  background: var(--surface); flex-wrap: wrap; gap: 1rem;
}
.logo { font-size: 1.5rem; font-weight: 900; letter-spacing: 2px; color: #fff; }
.logo span { color: var(--accent); }
.search-bar { display: flex; gap: 0.5rem; }
.search-bar input {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 0.5rem 1rem; border-radius: 4px; width: 280px; font-size: 0.9rem;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar button {
  background: var(--accent); color: #fff; border: none;
  padding: 0.5rem 1.2rem; border-radius: 4px; cursor: pointer; font-weight: 600;
}
.search-bar button:hover { background: #a82e25; }

/* Category Tabs */
.category-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  background: var(--surface); padding: 0 2rem; overflow-x: auto;
}
.tab {
  background: none; border: none; color: var(--muted);
  padding: 0.85rem 1.2rem; cursor: pointer; font-size: 0.9rem;
  border-bottom: 3px solid transparent; transition: all 0.2s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* Main */
main { max-width: 1400px; margin: 0 auto; padding: 2rem; }

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.article-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-image { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-img {
  width: 100%; height: 100%; background: linear-gradient(135deg, var(--surface), var(--bg));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: var(--border);
}
.category-badge {
  position: absolute; top: 0.5rem; left: 0.5rem;
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  padding: 0.2rem 0.5rem; border-radius: 3px; text-transform: uppercase;
}
.card-body { padding: 1rem; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent2); }
.card-summary { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.78rem; flex-wrap: wrap; }
.source { color: var(--accent2); font-weight: 600; }
.date { color: var(--muted); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.pagination button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 0.5rem 1.2rem; border-radius: 4px; cursor: pointer; font-size: 0.9rem;
}
.pagination button:hover { border-color: var(--accent); }
.pagination span { color: var(--muted); font-size: 0.9rem; }

/* Search Banner */
.search-banner {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); padding: 0.75rem 1rem; margin-bottom: 1.5rem;
  border-radius: 4px; display: flex; align-items: center; justify-content: space-between;
}
.search-banner .clear-search {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 0.3rem 0.8rem; border-radius: 3px; cursor: pointer; font-size: 0.8rem;
}
.search-banner .clear-search:hover { border-color: var(--accent); color: var(--text); }

/* States */
.loading, .empty { text-align: center; padding: 3rem; color: var(--muted); }
.hidden { display: none !important; }

/* Footer */
footer {
  border-top: 1px solid var(--border); padding: 1.5rem 2rem;
  text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 3rem;
}

/* --- Article Detail Page --- */
.article-detail { max-width: 900px; margin: 0 auto; padding: 2rem; }
.article-detail .hero-image { width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; margin-bottom: 1.5rem; background: var(--surface); }
.article-detail .hero-image img { width: 100%; height: 100%; object-fit: cover; }
.article-detail .meta { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; font-size: 0.85rem; }
.article-detail h1 { font-size: 1.8rem; font-weight: 800; line-height: 1.3; margin-bottom: 1rem; color: #fff; }
.article-detail .summary { font-size: 1.05rem; line-height: 1.8; color: var(--text); margin-bottom: 2rem; }
.article-detail .source-btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 0.75rem 2rem; border-radius: 6px; font-weight: 700; font-size: 1rem;
  text-decoration: none; transition: background 0.2s;
}
.article-detail .source-btn:hover { background: #a82e25; color: #fff; }
.article-detail .back-link { display: inline-block; margin-top: 1.5rem; color: var(--muted); font-size: 0.9rem; }
.article-detail .back-link:hover { color: var(--accent2); }
.article-detail .ref-links { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.article-detail .ref-links h3 { font-size: 1rem; color: var(--muted); margin-bottom: 0.75rem; }
.article-detail .ref-links ul { list-style: none; padding: 0; }
.article-detail .ref-links li { margin-bottom: 0.5rem; }
.article-detail .ref-links a { color: var(--accent2); font-size: 0.9rem; }

/* Video Embed */.video-embed { width: 100%; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; margin-bottom: 1.5rem; background: var(--surface); }.video-embed iframe { width: 100%; height: 100%; border: none; }
/* Responsive */
@media (max-width: 768px) {
  header { padding: 1rem; }
  .search-bar input { width: 180px; }
  .category-tabs { padding: 0 1rem; }
  main { padding: 1rem; }
  .article-grid { grid-template-columns: 1fr; }
  .article-detail { padding: 1rem; }
  .article-detail h1 { font-size: 1.4rem; }
}
