:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  padding-top: 12px;
  padding-bottom: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
}

.brand-footer .brand-logo {
  width: 34px;
  height: 34px;
}

.brand-accent {
  color: var(--accent);
}

.brand-footer .brand-accent {
  color: #60a5fa;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text small {
  font-size: 12px;
  color: var(--text-muted);
}

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

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rss-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid var(--border);
  padding: 6px 0;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover {
  background: var(--surface-alt);
  color: var(--text);
}
.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Search panel */
.search-panel {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 16px 0;
}
.search-form input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.search-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}
.search-hit {
  display: block;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
}
.search-hit:hover {
  border-color: var(--accent);
}
.search-hit strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}
.search-hit span {
  font-size: 12px;
  color: var(--text-muted);
}

/* Main */
.main-content {
  padding-top: 28px;
  padding-bottom: 56px;
}

/* Meta & badges */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.badge-subtle {
  background: var(--accent-soft);
  color: var(--accent);
}
.orig-tag {
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

/* Hero */
.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.hero-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.hero-card:hover .hero-media img {
  transform: scale(1.02);
}

.hero-body {
  padding: 22px 24px;
}
.hero-title {
  margin: 10px 0 10px;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.hero-title a {
  text-decoration: none;
}
.hero-title a:hover {
  color: var(--accent);
}
.hero-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

/* Top list */
.top-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.section-heading {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.top-list-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.compact-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.compact-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.compact-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}
.compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compact-body h3 {
  margin: 6px 0 0;
  font-size: 14.5px;
  line-height: 1.35;
}
.compact-body h3 a {
  text-decoration: none;
}
.compact-body h3 a:hover {
  color: var(--accent);
}

/* Sections & Cards */
.section-block {
  margin-top: 42px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}
.section-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.more-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.more-link:hover {
  text-decoration: underline;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.cards-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e2e8f0;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-body h2, .card-body h3 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.35;
}
.card-body h2 a, .card-body h3 a {
  text-decoration: none;
}
.card-body h2 a:hover, .card-body h3 a:hover {
  color: var(--accent);
}
.card-body p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Breadcrumbs & Category Header */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumbs a {
  text-decoration: none;
  color: var(--accent);
}
.breadcrumbs a:hover {
  text-decoration: underline;
}

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 72ch;
}

/* Article Page */
.article-layout {
  max-width: 820px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 36px;
  box-shadow: var(--shadow);
}
.article-header h1 {
  margin: 14px 0 12px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.22;
  letter-spacing: -0.02em;
}
.article-lead {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--text-muted);
}
.article-hero-figure {
  margin: 0 0 26px;
}
.article-hero-figure img {
  width: 100%;
  border-radius: 10px;
}
.article-prose {
  font-size: 17px;
  line-height: 1.72;
}
.article-prose h2 {
  margin: 28px 0 12px;
  font-size: 22px;
  line-height: 1.3;
}
.article-prose h3 {
  margin: 22px 0 10px;
  font-size: 18px;
}
.article-prose p {
  margin: 0 0 16px;
}
.article-prose ul, .article-prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.article-prose li {
  margin-bottom: 8px;
}
.article-prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface-alt);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.article-prose blockquote p:last-child {
  margin-bottom: 0;
}
.article-figure {
  margin: 24px 0;
}
.article-figure img {
  width: 100%;
  border-radius: 10px;
}
.article-figure figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.article-source {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-muted);
  word-break: break-all;
}
.article-source a {
  color: var(--accent);
}

/* 404 */
.not-found {
  text-align: center;
  padding: 48px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.btn-primary {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.brand-footer strong {
  color: #fff;
  font-size: 18px;
}
.footer-desc {
  margin: 12px 0 0;
  font-size: 14px;
  color: #94a3b8;
  max-width: 46ch;
}
.site-footer h3 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
}
.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #1e293b;
  font-size: 13px;
  color: #94a3b8;
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cards-grid, .cards-grid-4 { grid-template-columns: 1fr; }
  .article-layout { padding: 20px 18px; }
  .footer-grid { grid-template-columns: 1fr; }
}
