:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --border: #eef2f7;
  --shadow: 0 2px 6px rgba(0,0,0,.05);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.08);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #6366f1;
  --border: #334155;
  --shadow: 0 2px 6px rgba(0,0,0,.2);
  --shadow-hover: 0 4px 12px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #e7f0ff 0%, #f7f9fc 60%);
}

.site-header {
  padding: 24px 20px;
}

.header__content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__left { text-align: left; }

.header__left h1 { margin: 0 0 6px; font-size: 2rem; }
.header__left p { margin: 0; color: var(--muted); }

.theme-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.container { padding: 20px; max-width: 1100px; margin: 0 auto; }

.search-section {
  margin-bottom: 32px;
}

.search__input-wrapper {
  margin-bottom: 16px;
}

.search__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s;
}

.search__input:focus {
  outline: none;
  border-color: var(--accent);
}

.search__stats {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.tag-filter {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

.tag-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.news-section {
  margin-top: 48px;
}

.section__title {
  font-size: 1.5rem;
  margin: 0 0 20px;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-item {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.news-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.news-item__title {
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.news-item__title:hover {
  color: var(--accent);
}

.news-item__date {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 16px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

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

.card__icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  flex-shrink: 0;
}

.card__body { flex: 1; }
.card__title { margin: 0 0 8px; font-size: 1.15rem; }
.card__desc { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.card__link {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.card__link:hover { opacity: 0.9; }

.card__tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.card__tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--bg);
  border-radius: 4px;
  color: var(--muted);
}

.site-footer { text-align: center; padding: 20px; color: #64748b; }

@media (max-width: 600px) {
  .header__content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .header__left { text-align: center; }

  .card { flex-direction: column; align-items: flex-start; }
  .card__icon { width: auto; }

  .news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .news-item__date { margin-left: 0; }
}
