:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-accent: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
  --shadow-hover: 0 6px 18px rgba(17, 24, 39, 0.12);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 16px;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

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

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

.main {
  flex: 1 0 auto;
  padding: 32px 0 48px;
}

/* Header */
.header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 3.5rem;
  margin-right: 0.75rem;
  max-width: 100%;
}

.header__description {
  line-height: 1.25rem;
  font-size: 1.25rem;
}

.header__logo:hover {
  text-decoration: none;
}

.header__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.header__link {
  color: var(--color-muted);
  font-size: 15px;
}

.header__link--active,
.header__link:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* Titles */
.page-title {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
}

.page-lead {
  margin: 0 0 28px;
  color: var(--color-muted);
}

.empty {
  padding: 64px 0;
  text-align: center;
  color: var(--color-muted);
}

/* Cards */
.cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.card__link {
  display: flex;
  gap: 16px;
  padding: 16px;
  color: inherit;
}

.card__link:hover {
  text-decoration: none;
}

.card__cover {
  width: 140px;
  height: 100px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  background: var(--color-bg);
}

.card__body {
  min-width: 0;
}

.card__title {
  margin: 0 0 6px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 600;
}

.card:hover .card__title {
  color: var(--color-accent);
}

.card__excerpt {
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: 15px;
}

.card__date {
  color: var(--color-muted);
  font-size: 13px;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination__item {
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  text-align: center;
}

.pagination__item:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  text-decoration: none;
}

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

.pagination__item--disabled {
  color: #c4c8ce;
}

/* Article */
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--color-muted);
  font-size: 14px;
}

.article__title {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.2;
  font-weight: 700;
}

.article__date {
  display: block;
  margin-bottom: 20px;
  color: var(--color-muted);
  font-size: 14px;
}

.article__cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.article__excerpt {
  margin: 0 0 24px;
  padding-left: 16px;
  border-left: 3px solid var(--color-accent);
  color: #4b5563;
  font-size: 18px;
}

.article__body {
  font-size: 17px;
}

.article__body > *:first-child {
  margin-top: 0;
}

.article__body h2 {
  margin: 32px 0 12px;
  font-size: 24px;
  line-height: 1.3;
}

.article__body h3 {
  margin: 26px 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.article__body p,
.article__body ul,
.article__body ol,
.article__body blockquote,
.article__body figure,
.article__body table {
  margin: 0 0 18px;
}

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

.article__body li + li {
  margin-top: 6px;
}

.article__body img {
  border-radius: 8px;
}

.article__body blockquote {
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--color-border);
  color: var(--color-muted);
}

.article__body pre {
  padding: 14px 16px;
  overflow-x: auto;
  background: #111827;
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 14px;
}

.article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.article__body table {
  width: 100%;
  border-collapse: collapse;
}

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

.article__body hr {
  margin: 28px 0;
  border: none;
  border-top: 1px solid var(--color-border);
}

/* Error page */
.error-page {
  padding: 72px 16px;
  text-align: center;
}

.error-page__code {
  margin: 0;
  color: var(--color-border);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
}

.error-page__title {
  margin: 12px 0 8px;
  font-size: 26px;
}

.error-page__text {
  margin: 0 0 24px;
  color: var(--color-muted);
}

/* Footer */
.footer {
  flex: 0 0 auto;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.footer__copy {
  color: var(--color-muted);
  font-size: 14px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__link {
  color: var(--color-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .page-title {
    font-size: 26px;
  }

  .article__title {
    font-size: 27px;
  }

  .card__link {
    flex-direction: column;
  }

  .card__cover {
    width: 100%;
    height: 180px;
  }
}
