:root {
  --post-accent: #425aef;
  --post-accent-soft: rgba(66, 90, 239, .10);
  --post-border: rgba(66, 90, 239, .13);
  --post-shadow: 0 18px 50px rgba(37, 52, 102, .08);
  --post-code-bg: #11182d;
}

[data-theme='dark'] {
  --post-accent: #79a7ff;
  --post-accent-soft: rgba(121, 167, 255, .14);
  --post-border: rgba(255, 255, 255, .10);
  --post-shadow: 0 18px 50px rgba(0, 0, 0, .24);
  --post-code-bg: #0c1222;
}

/* Article hero */
#page-header.post-bg {
  height: 360px;
  min-height: 360px;
  background-attachment: scroll;
  background-position: center;
}

#page-header.post-bg:before {
  background: linear-gradient(135deg, rgba(10, 18, 42, .90), rgba(40, 75, 154, .54) 55%, rgba(7, 13, 30, .78));
}

#page-header.post-bg #nav {
  background: rgba(10, 18, 42, .18);
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  backdrop-filter: blur(14px);
}

#page-header.post-bg #post-info {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 2;
  padding: 0;
  width: min(1180px, calc(100% - 72px));
  transform: translateX(-50%);
  text-align: left;
}

#page-header.post-bg #post-info .post-title {
  max-width: 980px;
  margin: 0 0 16px;
  color: var(--white);
  font-size: clamp(2.25rem, 5vw, 4.25rem);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.12;
  text-align: left;
  text-shadow: 0 8px 26px rgba(0, 0, 0, .24);
}

#page-header.post-bg #post-info #post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  width: auto;
  padding: 0;
  color: rgba(255, 255, 255, .82);
  text-align: left;
}

#page-header.post-bg #post-info #post-meta .meta-firstline,
#page-header.post-bg #post-info #post-meta .meta-secondline,
#page-header.post-bg #post-info #post-meta .post-meta-date,
#page-header.post-bg #post-info #post-meta .post-meta-categories,
#page-header.post-bg #post-info #post-meta .post-meta-wordcount,
#page-header.post-bg #post-info #post-meta .post-meta-pv-cv,
#page-header.post-bg #post-info #post-meta .post-meta-commentcount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#page-header.post-bg #post-info #post-meta .meta-firstline,
#page-header.post-bg #post-info #post-meta .meta-secondline {
  gap: 16px;
}

#page-header.post-bg #post-info #post-meta .post-meta-separator {
  display: none;
}

#page-header.post-bg #post-info #post-meta .post-meta-icon {
  color: var(--post-accent);
}

#page-header.post-bg #post-info #post-meta a {
  color: inherit;
}

#page-header.post-bg #post-info #post-meta a:hover {
  color: var(--white);
}

/* Reading layout */
#body-wrap.post #content-inner.layout {
  align-items: flex-start;
  gap: 18px;
  max-width: 1320px;
  padding: 28px 15px 64px;
}

#body-wrap.post #content-inner.layout #post {
  box-sizing: border-box;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 42px 46px 50px;
  border: 1px solid var(--post-border);
  border-radius: 22px;
  background: var(--card-bg);
  box-shadow: var(--post-shadow);
}

#body-wrap.post #content-inner.layout #aside-content {
  flex: 0 0 325px;
  width: 325px;
  padding-left: 0;
}

#body-wrap.post #content-inner.layout #aside-content .card-widget {
  border: 1px solid var(--post-border);
  border-radius: 18px;
  box-shadow: var(--post-shadow);
}

#body-wrap.post #content-inner.layout #aside-content .sticky_layout {
  top: 78px;
}

#body-wrap.post #content-inner.layout #aside-content #card-toc {
  border-top: 3px solid var(--post-accent);
}

#body-wrap.post #content-inner.layout #aside-content .item-headline {
  color: var(--text-highlight-color);
}

#body-wrap.post #content-inner.layout #aside-content .toc-link {
  border-radius: 8px;
  color: var(--font-color);
}

#body-wrap.post #content-inner.layout #aside-content .toc-link:hover,
#body-wrap.post #content-inner.layout #aside-content .toc-link.active {
  color: var(--post-accent);
  background: var(--post-accent-soft);
}

/* Article typography */
#post #article-container {
  color: var(--font-color);
  font-size: 1.02rem;
  line-height: 1.9;
}

#post #article-container h1,
#post #article-container h2,
#post #article-container h3,
#post #article-container h4,
#post #article-container h5,
#post #article-container h6 {
  color: var(--text-highlight-color);
  font-weight: 800;
  letter-spacing: -.025em;
}

#post #article-container h1 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--post-border);
  font-size: 2rem;
  line-height: 1.3;
}

#post #article-container h2 {
  margin: 42px 0 18px;
  font-size: 1.65rem;
}

#post #article-container h3 {
  margin: 30px 0 14px;
  font-size: 1.3rem;
}

#post #article-container p {
  margin: 0 0 1.2em;
}

#post #article-container a {
  color: var(--post-accent);
  font-weight: 600;
}

#post #article-container a:hover {
  color: var(--text-highlight-color);
}

#post #article-container blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--post-accent);
  border-radius: 0 14px 14px 0;
  background: var(--post-accent-soft);
  color: var(--font-color);
}

#post #article-container blockquote p:last-child {
  margin-bottom: 0;
}

#post #article-container img {
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(31, 45, 85, .10);
}

#post #article-container pre {
  margin: 24px 0;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  background: var(--post-code-bg);
  box-shadow: 0 14px 28px rgba(17, 24, 45, .16);
}

#post #article-container code:not(pre code) {
  margin: 0 3px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--post-accent-soft);
  color: var(--post-accent);
}

#post #article-container table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--post-border);
  border-radius: 12px;
}

#post #article-container th,
#post #article-container td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--post-border);
}

#post #article-container th {
  background: var(--post-accent-soft);
  color: var(--text-highlight-color);
}

/* Restore Hexo's highlight.js table structure inside code blocks. */
#post #article-container figure.highlight {
  overflow: hidden;
  margin: 24px 0;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--hl-bg, var(--post-code-bg));
  color: var(--hl-color, #d7def5);
  box-shadow: 0 14px 28px rgba(17, 24, 45, .16);
}

#post #article-container figure.highlight table {
  display: block;
  overflow: auto;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#post #article-container figure.highlight td {
  padding: 0;
  border: 0;
  background: transparent;
  vertical-align: top;
}

#post #article-container figure.highlight pre,
#post #article-container figure.highlight .gutter pre,
#post #article-container figure.highlight .code pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#post #article-container figure.highlight pre {
  padding: 8px 0;
}

#post #article-container figure.highlight .gutter pre {
  padding-right: 12px;
  padding-left: 12px;
  background: var(--hlnumber-bg, rgba(255, 255, 255, .04));
  color: var(--hlnumber-color, rgba(215, 222, 245, .55));
  text-align: right;
}

#post #article-container figure.highlight .code pre {
  padding-right: 18px;
  padding-left: 18px;
  width: 100%;
}

/* Copyright, tags and sharing */
#post .post-copyright {
  margin: 34px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--post-border);
  border-radius: 16px;
  background: var(--post-accent-soft);
}

#post .tag_share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--post-border);
}

#post .tag_share:after {
  display: none;
}

#post .post-meta__tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#post .post-meta__tags {
  margin: 0;
  padding: 6px 12px;
  border: 1px solid var(--post-border);
  border-radius: 999px;
  color: var(--post-accent);
  background: var(--post-accent-soft);
  font-size: .8rem;
  font-weight: 700;
}

#post .post-meta__tags:hover {
  color: var(--white);
  background: var(--post-accent);
}

#post .post_share {
  float: none;
  margin: 0;
}

/* Previous and next articles */
#post #pagination.pagination-post {
  display: flex;
  overflow: hidden;
  margin-top: 42px;
  border: 1px solid var(--post-border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--post-shadow);
}

#post #pagination.pagination-post .prev-post,
#post #pagination.pagination-post .next-post {
  width: 50%;
}

#post #pagination.pagination-post .prev-post a,
#post #pagination.pagination-post .next-post a {
  background: var(--card-bg);
}

#post #pagination.pagination-post .prev-post a:hover,
#post #pagination.pagination-post .next-post a:hover {
  background: var(--post-accent-soft);
}

#post #pagination.pagination-post .cover {
  opacity: .32;
}

#post #pagination.pagination-post .pagination-info {
  padding: 20px 28px;
}

#post #pagination.pagination-post .prev_info,
#post #pagination.pagination-post .next_info {
  color: var(--text-highlight-color);
  font-weight: 800;
}

#post #pagination.pagination-post .prev-post .label,
#post #pagination.pagination-post .next-post .label {
  color: var(--post-accent);
  font-weight: 800;
}

/* Optional related posts and comments */
#post .relatedPosts,
#post #post-comment {
  margin-top: 40px;
  padding: 26px;
  border: 1px solid var(--post-border);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: var(--post-shadow);
}

#post .relatedPosts-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#post .relatedPosts-list div {
  width: auto;
  height: 160px;
  margin: 0;
  border-radius: 14px;
}

@media screen and (max-width: 900px) {
  #page-header.post-bg {
    height: 340px;
    min-height: 340px;
  }

  #page-header.post-bg #post-info {
    width: calc(100% - 48px);
  }

  #body-wrap.post #content-inner.layout {
    display: block;
    padding: 18px 12px 48px;
  }

  #body-wrap.post #content-inner.layout #post {
    padding: 34px 30px 40px;
  }

  #body-wrap.post #content-inner.layout #aside-content {
    width: auto;
    margin-top: 18px;
  }

  #body-wrap.post #content-inner.layout #aside-content .sticky_layout {
    position: static;
  }
}

@media screen and (max-width: 768px) {
  #page-header.post-bg {
    height: 330px;
    min-height: 330px;
  }

  #page-header.post-bg #post-info {
    bottom: 28px;
    width: calc(100% - 40px);
  }

  #page-header.post-bg #post-info .post-title {
    margin-bottom: 12px;
    font-size: clamp(2rem, 10vw, 3rem);
  }

  #page-header.post-bg #post-info #post-meta {
    gap: 6px 14px;
    font-size: .82rem;
  }

  #body-wrap.post #content-inner.layout #post {
    padding: 28px 20px 34px;
    border-radius: 17px;
  }

  #post #article-container {
    font-size: .98rem;
  }

  #post #article-container h1 {
    font-size: 1.7rem;
  }

  #post #article-container h2 {
    margin-top: 34px;
    font-size: 1.45rem;
  }

  #post .tag_share {
    align-items: flex-start;
    flex-direction: column;
  }

  #post #pagination.pagination-post {
    display: block;
  }

  #post #pagination.pagination-post .prev-post,
  #post #pagination.pagination-post .next-post {
    width: 100%;
  }

  #post .relatedPosts-list {
    grid-template-columns: 1fr;
  }
}
