:root {
  --site-header-height: 68px;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main {
  flex: 1;
  padding-top: var(--site-header-height);
}

nav {
  justify-content: center;
}

.site-header {
  height: var(--site-header-height);
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
}

.header-inner {
  position: relative;
}

.site-header .nav-toggle {
  display: none;
}

.menu-icon {
  position: relative;
  display: block;
  width: 16px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.menu-icon::after {
  position: absolute;
  top: 3px;
  right: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  content: "";
}

.button {
  border-color: var(--accent-idle);
  color: var(--accent-idle);
}

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

.button.primary {
  border-color: var(--accent-active);
  background: var(--accent-active);
  color: var(--accent-text);
}

.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-text);
}

.banner-slide:not(.is-active) {
  display: none;
}

.banner-slide.is-active {
  display: block;
  animation: banner-fade-in 0.35s ease;
}

.banner-slide span small {
  font-size: 14px;
}

.banner-slide span {
  bottom: 34px;
  color: var(--accent-text);
}

.banner-controls {
  position: absolute;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.hero-banner {
  position: relative;
  height: auto;
  aspect-ratio: 16 / 9;
}

.banner-dots {
  display: flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
}

.banner-dots button {
  width: 7px;
  height: 7px;
  min-height: 7px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--white-soft);
  cursor: pointer;
}

.banner-dots button[aria-current="true"] {
  width: 22px;
  border-radius: 5px;
  background: var(--accent-active);
}

.search-link {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: var(--text);
}

.search-icon {
  display: block;
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: url("../icons/search.svg") center / contain no-repeat;
  mask: url("../icons/search.svg") center / contain no-repeat;
}

.tags span {
  border: 1px solid var(--accent-tag);
  background: var(--transparent);
  color: var(--accent-tag);
}

@keyframes banner-fade-in {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.icon-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--line-hover);
  background: var(--surface);
}

.icon-button:focus-visible,
.search-link:focus-visible,
.author-links a:focus-visible,
.article-author-links a:focus-visible {
  outline: 2px solid var(--accent-idle);
  outline-offset: 2px;
}

.icon-button span {
  display: block;
  color: inherit;
  transform: translateY(-1px);
}

.author-links,
.article-author-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.author-links a,
.article-author-links a {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--social);
  background: var(--transparent);
  transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.author-links a svg,
.article-author-links a svg,
.social-icon {
  display: block;
  width: 18px;
  height: 18px;
}

.social-icon {
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.social-icon-bilibili {
  -webkit-mask-image: url("../icons/bilibili.svg");
  mask-image: url("../icons/bilibili.svg");
}

.social-icon-douyin {
  -webkit-mask-image: url("../icons/douyin.svg");
  mask-image: url("../icons/douyin.svg");
}

.social-icon-redbook {
  -webkit-mask-image: url("../icons/redbook.svg");
  mask-image: url("../icons/redbook.svg");
}

.author-links a:hover,
.article-author-links a:hover {
  color: var(--accent-tag);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.card-image {
  position: relative;
  width: 209.33px;
  height: 157px;
  flex: 0 0 209.33px;
  aspect-ratio: 4 / 3;
  align-self: flex-start;
  overflow: hidden;
}

.article-grid .article-card {
  height: 157px;
}

.article-grid .card-body {
  overflow: hidden;
  padding-top: 10px;
  padding-bottom: 10px;
}

.article-related-grid .card-image {
  display: block;
  width: 100%;
  height: auto;
  flex-basis: auto;
  aspect-ratio: 4 / 3;
}

.home-hero {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-top: 24px;
  padding-right: max(24px, calc((100% - 1240px) / 2));
  padding-left: max(24px, calc((100% - 1240px) / 2));
  padding-bottom: 24px;
  background: var(--surface);
  border-top: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.hero-copy > .eyebrow {
  font-size: 12px;
}

.site-footer {
  min-height: 92px;
  height: auto;
  flex: 0 0 auto;
  padding: 34px 0 22px;
  background: var(--glass);
  border-top: 1px solid var(--line);
}

.site-footer .footer-inner {
  display: grid;
  height: auto;
  align-items: stretch;
  justify-content: initial;
  gap: 28px;
}

.site-footer .footer-inner.footer-has-links {
  grid-template-columns: minmax(0, 1fr) minmax(240px, .42fr);
  align-items: center;
  gap: 28px;
}

.footer-links {
  display: flex;
  grid-column: 1;
  flex-direction: column;
  gap: 13px;
}

.footer-links-heading {
  display: block;
}

.footer-links-heading .eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 10px;
}

.footer-links-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -.03em;
}

.footer-links-list {
  display: flex;
  min-width: 0;
  align-items: stretch;
  justify-content: start;
}

.footer-links-list--mobile {
  display: none;
}

.footer-links-list--desktop {
  display: grid;
  width: max-content;
  max-width: 100%;
  grid-template-columns: repeat(var(--footer-link-columns, 1), minmax(150px, max-content));
  justify-content: start;
}

.footer-links-list--desktop .footer-links-column {
  align-items: flex-start;
}

.footer-links-column {
  display: flex;
  min-width: 150px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 0 24px;
  border-left: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}

.footer-links-column-inner {
  display: inline-flex;
  width: max-content;
  flex-direction: column;
  gap: 8px;
}

.footer-links-column:first-child {
  padding-left: 0;
  border-left: 0;
}

.footer-link-text {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  transition: color .2s ease;
}

.footer-link-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 3px;
  object-fit: contain;
}

.footer-link-text:hover {
  color: var(--accent);
}

.footer-meta {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: flex-end;
  flex-direction: column;
  justify-content: flex-end;
  align-self: end;
  gap: 6px;
  justify-self: end;
  text-align: right;
}

.footer-copyright,
.footer-meta-item {
  color: var(--muted);
  font-size: 12px;
}

.footer-security-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.footer-security-link img {
  display: block;
  width: 18px;
  height: 20px;
  flex: 0 0 18px;
  object-fit: contain;
}

.footer-meta a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 767.98px) {
  .site-footer {
    min-height: 92px;
    padding: 28px 0 18px;
  }

  .footer-inner {
    gap: 22px;
  }

  .site-footer .footer-inner.footer-has-links {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .footer-links {
    grid-column: 1;
    align-items: stretch;
    gap: 13px;
  }

  .footer-links-heading {
    text-align: center;
  }

  .footer-links-list {
    width: min(100%, 360px);
    margin-inline: auto;
  }

  .footer-links-list--desktop {
    display: none;
  }

  .footer-links-list--mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .footer-links-list--mobile .footer-links-column {
    display: flex;
    min-width: 0;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
  }

  .footer-links-list--mobile .footer-links-column:first-child {
    padding-left: 16px;
    border-left: 0;
  }

  .footer-links-list--mobile .footer-links-column-inner {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .footer-links-list--mobile .footer-link-text {
    width: 100%;
    padding: 0;
    justify-content: flex-start;
  }

  .footer-meta {
    grid-column: 1;
    grid-row: auto;
    align-items: center;
    align-self: auto;
    flex-direction: column;
    justify-self: center;
    gap: 8px;
    text-align: center;
  }

  .site-footer .shell {
    display: grid;
    justify-content: initial;
  }

  .brand small {
    display: none;
  }

  .site-header nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    gap: 2px;
    flex-direction: column;
    padding: 8px;
    border: 1px solid var(--line);
    background: var(--menu-surface);
    box-shadow: var(--shadow-card);
  }

  .site-header.is-nav-open nav {
    display: flex;
  }

  .site-header nav a {
    padding: 10px 12px;
    border-radius: 6px;
  }

  .site-header nav a:hover,
  .site-header nav a:focus-visible {
    background: var(--soft);
  }

  .site-header .nav-toggle {
    display: inline-grid;
  }

  .home-hero {
    padding: 24px 14px;
  }

  .home-hero .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero .hero-actions .button {
    width: 100%;
  }

  .home-hero .author-links {
    width: 100%;
    justify-content: center;
  }

  .article-grid .article-card {
    display: block;
    height: auto;
    min-height: 0;
  }

  .article-grid .card-image {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    flex-basis: auto;
    aspect-ratio: 4 / 3;
  }

  .article-grid .card-body {
    overflow: visible;
    padding: 14px 15px 16px;
  }

  .article-grid .article-card h3 {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
  }

  .article-grid .article-card p {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
  }

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

  .article-related-grid .article-card {
    display: block;
    height: auto;
    min-height: 0;
  }

  .article-related-grid .card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .article-related-grid .card-body {
    min-height: 0;
    overflow: visible;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .shell {
    width: calc(100% - 48px);
    max-width: none;
  }

  .home-sections {
    width: calc(100% - 48px);
    margin-right: auto;
    margin-left: auto;
  }

  .home-hero {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .article-grid,
  .article-related-grid {
    grid-template-columns: 1fr;
  }

  .article-grid .article-card,
  .article-related-grid .article-card {
    display: flex;
    height: auto;
    min-height: 0;
    align-items: flex-start;
  }

  .article-grid .card-image,
  .article-related-grid .card-image {
    width: 36%;
    height: auto;
    flex: 0 0 36%;
    align-self: flex-start;
    aspect-ratio: 4 / 3;
  }

  .article-grid .card-body,
  .article-related-grid .card-body {
    min-width: 0;
    overflow: hidden;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .article-grid .article-card h3,
  .article-related-grid .article-card h3 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .article-grid .article-card p,
  .article-related-grid .article-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .article-grid .tags,
  .article-related-grid .tags {
    margin-top: auto;
  }

  .posts-layout {
    grid-template-columns: 220px 1fr;
  }

  .category-nav {
    position: sticky;
    display: block;
    top: 88px;
    overflow: visible;
  }

  .category-nav p {
    display: block;
  }

  .category-nav a {
    white-space: normal;
  }

  .content-section {
    padding: 28px 30px;
  }

  .section-heading {
    align-items: end;
    flex-direction: row;
  }

  .site-footer .shell {
    display: grid;
  }

  .site-header .shell {
    width: calc(100% - 32px);
    max-width: none;
  }

  .site-header .header-inner {
    gap: 18px;
  }

  .site-header .nav-toggle {
    display: none;
  }

  .site-header nav {
    position: static;
    display: flex;
    gap: 18px;
    flex: 1;
    flex-direction: row;
    padding: 0;
    border: 0;
    background: var(--transparent);
    box-shadow: none;
  }

  .site-header nav a {
    padding: 0;
  }

  .site-header nav a:hover,
  .site-header nav a:focus-visible {
    background: var(--transparent);
  }

  .site-header .header-tools {
    margin-left: 0;
  }

  .home-hero {
    grid-template-columns: 0.72fr 1.28fr;
    gap: 32px;
  }
}

@media (min-width: 1200px) {
  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-grid .article-card {
    height: 157px;
  }
}

.error-page {
  min-height: min(520px, calc(100vh - 180px));
  display: grid;
  align-content: center;
  justify-items: start;
  padding-top: 56px;
  padding-bottom: 72px;
}

.error-page h1 {
  margin: 0 0 12px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.05;
}

.error-page p:not(.eyebrow) {
  max-width: 34rem;
  margin: 0 0 28px;
  color: var(--text-secondary);
}
