:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f0;
  --text: #18212f;
  --muted: #697386;
  --line: #dbe2ea;
  --accent: #196d5f;
  --accent-strong: #124f46;
  --warning: #a45b2a;
  --shadow: 0 10px 24px rgba(24, 33, 47, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.stats {
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 14px;
  text-align: right;
  box-shadow: var(--shadow);
}

.stats span {
  display: block;
  font-size: 24px;
  font-weight: 750;
}

.stats small {
  color: var(--muted);
}

.filters {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

select,
input,
button {
  height: 42px;
  border-radius: 8px;
  font: inherit;
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 22px;
  font-weight: 750;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.news-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.news-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-main {
  padding: 18px 18px 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.category {
  display: inline-flex;
  max-width: 100%;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  padding: 3px 9px;
  font-weight: 750;
}

h2 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.35;
}

h2 a {
  color: var(--text);
  text-decoration: none;
}

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

.summary,
.preview {
  margin: 0;
  color: var(--muted);
}

.summary {
  color: var(--text);
  font-weight: 600;
}

.preview {
  margin-top: 8px;
}

.news-card footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 10px 18px;
  color: var(--muted);
  font-size: 13px;
}

.news-card footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-card footer strong {
  color: var(--warning);
  white-space: nowrap;
}

.empty-state {
  margin-top: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 48px 20px;
  text-align: center;
}

.empty-state h2 {
  margin-top: 0;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

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

.pagination .disabled {
  color: var(--muted);
  opacity: 0.55;
}

.detail-shell {
  max-width: 900px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.detail-article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-article header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}

.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.detail-article h1 {
  min-width: 0;
  margin-top: 0;
  font-size: 30px;
}

.copy-button {
  width: auto;
  min-width: 112px;
  flex: 0 0 auto;
  padding: 0 16px;
}

.detail-summary {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 650;
}

.detail-summary :first-child,
.detail-content :first-child {
  margin-top: 0;
}

.detail-summary :last-child,
.detail-content :last-child {
  margin-bottom: 0;
}

.detail-content {
  padding: 24px;
  color: var(--text);
  font-size: 16px;
}

.detail-content h1,
.detail-content h2,
.detail-content h3 {
  line-height: 1.35;
}

.detail-content h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

.detail-content h2 {
  margin: 26px 0 10px;
  font-size: 22px;
}

.detail-content h3 {
  margin: 22px 0 8px;
  font-size: 18px;
}

.detail-content p,
.detail-content li {
  color: var(--text);
}

.detail-content p {
  margin: 10px 0;
}

.detail-content ul,
.detail-content ol {
  padding-left: 24px;
}

.detail-content blockquote {
  margin: 16px 0;
  border-left: 4px solid var(--accent);
  background: var(--surface-soft);
  padding: 10px 14px;
  color: var(--muted);
}

.detail-content code {
  border-radius: 4px;
  background: #eef1f5;
  padding: 2px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.detail-content pre {
  overflow-x: auto;
  border-radius: 8px;
  background: #18212f;
  color: #f8fafc;
  padding: 14px;
}

.detail-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.detail-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.detail-content th,
.detail-content td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.detail-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  padding: 12px 24px;
  color: var(--muted);
  font-size: 13px;
}

.detail-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-footer strong {
  color: var(--warning);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1160px);
    padding-top: 20px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    text-align: left;
  }

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

  button {
    width: 100%;
  }

  .news-card footer {
    flex-direction: column;
    gap: 4px;
  }

  .detail-article header,
  .detail-content,
  .detail-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .detail-title-row {
    flex-direction: column;
    gap: 12px;
  }

  .detail-footer {
    flex-direction: column;
    gap: 4px;
  }
}
