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

:root {
  --primary: #1a3a5c;
  --primary-dark: #0f2440;
  --primary-light: #2c5f8a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --text: #1e293b;
  --text-light: #64748b;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 70px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  background: var(--primary-dark);
  color: var(--white);
  height: var(--header-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--white);
}

.logo:hover {
  color: var(--white);
  opacity: 0.9;
}

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

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

.nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--white);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: var(--white);
  padding: 80px 0 64px;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.search-bar {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.search-bar input {
  flex: 1;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text);
}

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

.search-bar button {
  padding: 16px 28px;
  background: var(--accent);
  color: var(--white);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.search-bar button:hover {
  background: var(--accent-hover);
}

/* Featured Section */
.featured {
  padding: 48px 0 24px;
}

.featured h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

.featured-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: row;
  transition: transform 0.2s;
}

.featured-card:hover {
  transform: translateY(-2px);
}

.featured-card-img {
  width: 360px;
  min-height: 240px;
  object-fit: cover;
  flex-shrink: 0;
}

.featured-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card-body .category {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  width: fit-content;
}

.featured-card-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--primary-dark);
}

.featured-card-body p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.featured-card-body .date {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Article Grid */
.articles {
  padding: 32px 0 64px;
}

.articles h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--primary);
}

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

.article-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

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

.article-card-body .category {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
  width: fit-content;
}

.article-card-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.article-card-body h3 a {
  color: inherit;
}

.article-card-body h3 a:hover {
  color: var(--accent);
}

.article-card-body p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
}

.article-card-body .date {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 12px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Article Page */
.article-page {
  padding: 40px 0 64px;
  flex: 1;
}

.article-page .container {
  max-width: 800px;
}

.article-header {
  margin-bottom: 32px;
}

.article-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.article-header .back-link:hover {
  color: var(--accent);
}

.article-header .category {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.article-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.article-header .meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

.article-featured-img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
  margin: 28px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  font-size: 1.02rem;
  line-height: 1.75;
}

.article-content ul, .article-content ol {
  margin: 0 0 20px 24px;
}

.article-content li {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.7;
}

.article-content strong {
  color: var(--primary-dark);
}

.article-content .highlight-box {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
}

.article-content .highlight-box p:last-child {
  margin-bottom: 0;
}

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

.related-articles h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
}

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

.related-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.related-card:hover {
  transform: translateY(-2px);
}

.related-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.related-card p {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* Ad Container */
.ad-container {
  width: 100%;
  margin: 30px auto;
  padding: 15px;
  text-align: center;
  border: 1px solid #e5e5e5;
  background: #fafafa;
  border-radius: 10px;
}

.ad-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 8px;
  display: block;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 32px 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
}

.footer a {
  color: rgba(255,255,255,0.85);
}

.footer a:hover {
  color: var(--white);
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 48px 0 40px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

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

  .search-bar {
    flex-direction: column;
    border-radius: var(--radius-sm);
  }

  .search-bar input {
    padding: 14px 16px;
  }

  .search-bar button {
    padding: 14px;
  }

  .featured-card {
    flex-direction: column;
  }

  .featured-card-img {
    width: 100%;
    height: 200px;
  }

  .featured-card-body {
    padding: 24px;
  }

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

  .article-header h1 {
    font-size: 1.6rem;
  }

  .article-content h2 {
    font-size: 1.3rem;
  }

  .article-content h3 {
    font-size: 1.1rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

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

  .header .container {
    flex-direction: column;
    gap: 8px;
    padding: 8px 16px;
  }

  .header {
    height: auto;
    padding: 8px 0;
  }
}
