:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #1478d4;
  --blue-dark: #0f63b4;
  --red: #ef3838;
  --green: #16a085;
  --purple: #8e44ad;
  --orange: #f39c12;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: #6b7280;
  font-size: 12px;
}

.topbar-inner {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  color: var(--text);
}

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

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--red);
  font-size: 22px;
  line-height: 1.1;
}

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

.nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}

.nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  background: var(--blue);
  color: #fff;
  text-decoration: none;
}

.notice {
  min-height: 36px;
  display: flex;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.search-band {
  padding: 16px 0;
  background: #eaf5ff;
  border-bottom: 1px solid #cbe3fb;
}

.search-box,
.side-search {
  display: flex;
}

.search-box input,
.side-search input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-right: 0;
  background: #fff;
  color: var(--text);
  outline: 0;
}

.search-box input {
  height: 46px;
  padding: 0 16px;
  border-color: var(--blue);
  border-radius: 5px 0 0 5px;
  font-size: 16px;
}

.side-search input {
  height: 34px;
  padding: 0 10px;
  border-radius: 4px 0 0 4px;
}

.search-box button,
.side-search button,
.button {
  border: 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.search-box button {
  width: 110px;
  border-radius: 0 5px 5px 0;
  font-size: 16px;
}

.side-search button {
  width: 68px;
  border-radius: 0 4px 4px 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 4px;
}

.search-box button:hover,
.side-search button:hover,
.button:hover {
  background: var(--blue-dark);
  text-decoration: none;
}

.magazine,
.content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  padding: 14px 0 36px;
}

.main-column {
  min-width: 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
  height: 262px;
}

.feature-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  min-height: 0;
}

.image-card {
  position: relative;
  display: block;
  overflow: hidden;
  height: 100%;
  min-height: 0;
  border-radius: 5px;
  background: #1f2937;
  color: #fff;
  box-shadow: var(--shadow);
}

.image-card:hover {
  text-decoration: none;
}

.feature-large {
  height: 262px;
}

.feature-small {
  height: 126px;
}

.image-card img,
.thumb-fallback {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1f2937, #1478d4 52%, #16a085);
}

.thumb-fallback span {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 36px;
  font-weight: 800;
}

.demo-card {
  background: linear-gradient(135deg, #2d3748, #1478d4);
}

.demo-card.alt {
  background: linear-gradient(135deg, #374151, #16a085);
}

.demo-card.third {
  background: linear-gradient(135deg, #1f2937, #ef3838);
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.72));
}

.image-card strong,
.card-label {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.image-card strong {
  bottom: 16px;
  font-size: 18px;
  line-height: 1.25;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feature-small strong {
  font-size: 13px;
  -webkit-line-clamp: 2;
}

.card-label {
  bottom: 50px;
  font-size: 12px;
  font-weight: 700;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  min-height: 154px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.post-thumb {
  display: block;
  height: 154px;
  min-height: 154px;
  background: #d1d5db;
}

.post-thumb img,
.post-thumb .thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body {
  min-width: 0;
  padding: 12px 14px;
}

.post-card h2 {
  margin: 4px 0 7px;
  font-size: 15px;
  line-height: 1.38;
}

.post-card h2 a {
  color: #111827;
}

.post-card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.meta,
.tags,
.source,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-header .tags {
  margin-top: 10px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
}

.side-card {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.profile-card {
  text-align: center;
}

.profile-card .avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  font-size: 30px;
}

.profile-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.stats strong {
  display: block;
  color: #111827;
  font-size: 15px;
}

.side-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red);
  font-size: 15px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.tag-cloud a:nth-child(2n) {
  background: var(--green);
}

.tag-cloud a:nth-child(3n) {
  background: var(--red);
}

.tag-cloud a:nth-child(4n) {
  background: var(--purple);
}

.tag-cloud a:nth-child(5n) {
  background: var(--orange);
}

.tag-cloud a:hover {
  text-decoration: none;
  filter: brightness(0.95);
}

.tag-cloud.compact a {
  min-height: 26px;
  padding: 0 9px;
  background: #eef6ff;
  color: var(--blue-dark);
  border: 1px solid #cbe3fb;
}

.popular-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: popular;
}

.popular-list li {
  position: relative;
  min-height: 42px;
  padding: 10px 0 10px 38px;
  border-bottom: 1px solid var(--line);
  counter-increment: popular;
}

.popular-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.popular-list li::before {
  content: counter(popular);
  position: absolute;
  left: 0;
  top: 11px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.popular-list li:nth-child(1)::before {
  background: var(--red);
}

.popular-list li:nth-child(2)::before {
  background: var(--orange);
}

.popular-list a {
  display: -webkit-box;
  overflow: hidden;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.popular-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.search-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-links a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 4px;
  background: #eef6ff;
  border: 1px solid #cbe3fb;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.search-links a:hover {
  border-color: #cbe3fb;
  background: #eef6ff;
  color: var(--blue-dark);
  text-decoration: none;
}

.page-head {
  padding: 8px 0 14px;
}

.page-head h1 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.2;
}

.page-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.compact-head {
  margin-bottom: 2px;
}

.article {
  max-width: none;
  padding: 4px 0 56px;
}

.article-header h1 {
  margin: 8px 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.18;
}

.lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
}

.article-cover {
  width: 100%;
  max-height: 430px;
  object-fit: cover;
  margin: 22px 0;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.toc,
.cta {
  margin: 24px 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.content {
  font-size: 16px;
}

.content h2,
.content h3 {
  margin-top: 32px;
  line-height: 1.25;
}

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

.brand-identity,
.brand-product {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.brand-identity img {
  display: block;
  width: min(260px, 100%);
  max-height: 88px;
  margin: 0 auto;
  object-fit: contain;
}

.brand-product img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
  background: #f8fafc;
}

.brand-identity figcaption,
.brand-product figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 980px) {
  .magazine,
  .content-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .header-inner {
    min-height: 0;
    flex-direction: column;
    padding: 12px 0 0;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .nav {
    width: calc(100% + 32px);
    margin: 0 -16px;
  }

  .nav a {
    min-height: 46px;
  }

  .featured-grid,
  .post-list,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .featured-grid {
    height: auto;
  }

  .feature-large,
  .feature-small {
    height: 220px;
  }

  .post-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .search-box button {
    width: 88px;
  }
}

@media (max-width: 480px) {
  .post-card {
    grid-template-columns: 1fr;
  }

  .post-thumb {
    min-height: 180px;
  }
}
