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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f7;
  --bg-card: #ffffff;
  --bg-card-hover: #fafafa;
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #86868b;
  --accent-blue: #0071e3;
  --accent-gradient: linear-gradient(135deg, #0071e3, #0077ed);
  --border-color: #d2d2d7;
  --border-light: #e8e8ed;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --transition: 0.3s ease;
  --transition-fast: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 22px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}

.logo-icon {
  font-size: 1.3rem;
}

.logo-text {
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-accent {
  color: var(--accent-blue);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 400;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
}

.last-update {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* HERO */
.hero {
  padding: 80px 22px 60px;
  text-align: center;
}

.hero-content {
  max-width: 680px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  font-weight: 400;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* MAIN */
.main {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 22px 80px;
}

/* CONTROLS */
.controls {
  margin-bottom: 40px;
}

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 400;
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
  font-weight: 500;
}

/* ARTICLES GRID */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ARTICLE CARD */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-color);
}

.article-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-secondary);
}

.article-image-placeholder {
  width: 100%;
  height: 180px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.3;
}

.article-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.source-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.article-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.article-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-link {
  margin-top: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--transition);
}

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

.article-link::after {
  content: '→';
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
}

.page-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 400;
}

.page-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.page-btn.active {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: white;
  font-weight: 500;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 12px;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 60px 22px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* LOADING */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* FOOTER */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 48px 22px 0;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand .logo {
  font-size: 1rem;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  max-width: 280px;
  line-height: 1.6;
}

.footer-links h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.footer-links li:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding: 16px 0;
  text-align: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .hero {
    padding: 60px 20px 40px;
  }

  .hero-stats {
    gap: 32px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .header-actions {
    display: none;
  }

  .main {
    padding: 24px 20px 60px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

  .filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .search-input {
    padding: 10px 14px 10px 40px;
    font-size: 0.95rem;
  }

  .article-body {
    padding: 16px;
  }

  .article-title {
    font-size: 0.95rem;
  }
}

/* Subtle animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-card {
  animation: fadeIn 0.4s ease-out both;
}

.article-card:nth-child(1) { animation-delay: 0s; }
.article-card:nth-child(2) { animation-delay: 0.05s; }
.article-card:nth-child(3) { animation-delay: 0.1s; }
.article-card:nth-child(4) { animation-delay: 0.15s; }
.article-card:nth-child(5) { animation-delay: 0.2s; }
.article-card:nth-child(6) { animation-delay: 0.25s; }
.article-card:nth-child(7) { animation-delay: 0.3s; }
.article-card:nth-child(8) { animation-delay: 0.35s; }
.article-card:nth-child(9) { animation-delay: 0.4s; }

/* Selection */
::selection {
  background: rgba(0, 113, 227, 0.15);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}