:root {
  color-scheme: light;
  --ink: #242424;
  --muted: #858585;
  --line: #e8e8e8;
  --page: #cfcfcf;
  --surface: #ffffff;
  --nav: #1f1f1f;
  --accent: #e8133d;
  --accent-dark: #bd1231;
  --soft: #f6f6f6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    "Noto Sans SC",
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
}

.site-masthead {
  background: var(--surface);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1114px, calc(100% - 48px));
  min-height: 120px;
  margin: 0 auto;
}

.site-title {
  display: grid;
  gap: 3px;
}

.site-title span {
  color: #181818;
  font-size: clamp(2rem, 5vw, 3.05rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.site-title small {
  color: #444;
  font-size: 0.95rem;
}

.social-links {
  display: flex;
  gap: 2px;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #f2f2f2;
  color: #111;
}

.social-links a:hover,
.social-links a:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
}

.social-links svg,
.post-footer svg {
  width: 16px;
  height: 16px;
}

.site-nav {
  background: var(--nav);
  color: #f5f5f5;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  width: min(1114px, 100%);
  margin: 0 auto;
}

.nav-inner a {
  min-height: 50px;
  padding: 15px 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.96rem;
}

.nav-inner a:hover,
.nav-inner a:focus-visible {
  background: #111;
  color: #fff;
  outline: none;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 328px;
  gap: 20px;
  width: min(1114px, calc(100% - 48px));
  margin: 20px auto 36px;
  align-items: start;
}

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

.article-shell {
  display: block;
  min-width: 0;
}

.post-card,
.widget {
  background: var(--surface);
  border: 1px solid var(--line);
}

.post-card {
  min-width: 0;
}

.post-image {
  position: relative;
  display: block;
  margin: 20px 20px 0;
  aspect-ratio: 1.85 / 1;
  overflow: hidden;
  background: #ddd;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 240ms ease;
}

.post-image:hover img {
  transform: scale(1.035);
}

.post-detail {
  min-width: 0;
}

.post-detail .post-body {
  padding: 22px 30px 34px;
}

.post-detail-hero {
  margin: 20px 20px 0;
  max-height: 260px;
  overflow: hidden;
}

.post-detail-hero img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px 20px 0;
  color: var(--accent);
  font-size: 0.95rem;
}

.back-link svg {
  width: 17px;
  height: 17px;
}

.image-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: color;
  opacity: 0.56;
  pointer-events: none;
}

.tint-green::after {
  background: #6dbb52;
}

.tint-blue::after {
  background: #4a87c2;
}

.tint-red::after {
  background: #d8414b;
}

.tint-gold::after {
  background: #d8a334;
}

.tint-slate::after {
  background: #6f7580;
}

.post-body {
  padding: 14px 20px 20px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.post-body h1,
.post-body h2 {
  margin: 0;
  color: #333;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

.post-body h1 {
  font-size: 1.35rem;
}

.post-body h2 {
  font-size: 1.28rem;
}

.post-body h1 a:hover,
.post-body h2 a:hover,
.mini-post:hover span,
.link-list a:hover {
  color: var(--accent);
}

.post-meta {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.post-body p:not(.post-meta) {
  margin: 0 0 20px;
  color: #414141;
  font-size: 0.96rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 22px;
}

.tag-row span {
  padding: 5px 9px;
  background: var(--soft);
  color: #555;
  font-size: 0.86rem;
}

.article-content {
  color: #343434;
  font-size: 1.02rem;
  line-height: 1.9;
  white-space: pre-wrap;
}

.read-more {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
}

.read-more:hover,
.read-more:focus-visible,
.tab-button.active {
  background: var(--accent-dark);
  outline: none;
}

.post-footer {
  display: grid;
  gap: 5px;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: #a0a0a0;
  font-size: 0.88rem;
}

.post-footer span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sidebar {
  display: grid;
  gap: 20px;
}

.widget {
  padding: 20px;
}

.widget h2 {
  margin: 0 0 14px;
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.25;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 0.88rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 14px;
}

.tab-panel > a:not(.mini-post) {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
}

.mini-post {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  column-gap: 14px;
  align-items: start;
  min-height: 72px;
}

.mini-post img {
  grid-row: span 2;
  width: 80px;
  height: 58px;
  object-fit: cover;
}

.mini-post span {
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1.45;
}

.mini-post small {
  color: var(--muted);
  font-size: 0.78rem;
}

.tag-cloud {
  display: none;
}

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

.tag-cloud a {
  padding: 6px 9px;
  background: var(--soft);
  border: 0;
}

.link-list {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list a {
  color: var(--accent);
}

.author-widget p {
  margin: 0;
  color: #555;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px max(24px, calc((100% - 1114px) / 2));
  background: #1d1d1d;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #fff;
  white-space: nowrap;
}

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

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

  .author-widget,
  #official {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .masthead-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: 146px;
  }

  .nav-inner {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .nav-inner a {
    flex: 0 0 auto;
    padding-inline: 16px;
  }

  .page-shell,
  .masthead-inner {
    width: min(100% - 28px, 1114px);
  }

  .content-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .author-widget,
  #official {
    grid-column: auto;
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 18px;
  }
}

@media (max-width: 460px) {
  .post-image {
    margin: 14px 14px 0;
  }

  .post-body,
  .widget {
    padding: 16px 14px;
  }

  .post-detail .post-body {
    padding: 18px 16px 24px;
  }

  .post-detail-hero {
    margin: 14px 14px 0;
  }

  .post-detail-hero,
  .post-detail-hero img {
    max-height: 190px;
    height: 190px;
  }

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

  .mini-post img {
    width: 68px;
    height: 52px;
  }
}
