/* 博客原型 - 对齐 blog.rahc.top (NotionNext 杂志布局)
 * 参考: https://blog.rahc.top/
 * Figma: https://www.figma.com/design/1N9htYFcWgLAehi0nLKkLJ/%E5%8D%9A%E5%AE%A2
 */

:root {
  --color-page: #f3f4f6;
  --color-white: #ffffff;
  --color-card: #ffffff;
  --color-text: #374151;
  --color-text-dark: #1f2937;
  --color-text-muted: #9ca3af;
  --color-text-light: #6b7280;
  --color-primary: #928cee;
  --color-primary-hover: #7c75e8;
  --color-border: #e5e7eb;
  --color-tag-yellow: #fbf3db;
  --color-tag-pink: #f4dfeb;
  --color-tag-blue: #dbeafe;
  --color-tag-green: #dcfce7;
  --color-footer-bg: #ebebeb;
  --color-link: #4338ca;
  --color-callout-bg: #f9fafb;
  --color-table-head: #f3f4f6;
  --color-hero-shade: rgba(0, 0, 0, 0.45);

  --font-sans: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-max: 1200px;
  --sidebar-width: 300px;
  --catalog-width: 240px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --card-height: 224px;

  /* md-editor-v3 代码块（对齐 preview 默认变量） */
  --code-radius: 5px;
  --code-bg: #282c34;
  --code-head-bg: #282c34;
  --code-text: #a9b7c6;
  --code-lang: #a9b7c6;
  --code-copy: #a9b7c6;
  --code-copy-active: #61aeee;
}

[data-theme="dark"] {
  --color-page: #121212;
  --color-white: #1e1e1e;
  --color-card: #1e1e1e;
  --color-text: #d1d5db;
  --color-text-dark: #f3f4f6;
  --color-text-muted: #9ca3af;
  --color-text-light: #9ca3af;
  --color-primary: #928cee;
  --color-primary-hover: #a89ef5;
  --color-border: #374151;
  --color-tag-yellow: #3d3520;
  --color-tag-pink: #3d2a35;
  --color-tag-blue: #1e3a5f;
  --color-tag-green: #1a3d2a;
  --color-footer-bg: #0d0d0d;
  --color-link: #a5b4fc;
  --color-callout-bg: #252525;
  --color-table-head: #2a2a2a;
  --color-hero-shade: rgba(0, 0, 0, 0.6);

  --code-bg: #1a1a1a;
  --code-head-bg: #1a1a1a;
  --code-text: #a9b7c6;
  --code-lang: #a9b7c6;
  --code-copy: #a9b7c6;
  --code-copy-active: #e6c07b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== Hero（全屏封面 + 透明导航） ========== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background: var(--color-hero-shade);
}

/* 全站统一导航（对齐 blog.rahc.top NotionNext #sticky-nav 动画） */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  transform: translateY(0);
  transition:
    transform 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    backdrop-filter 0.3s ease;
}

.site-nav.is-hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

.site-nav.is-overlay,
.site-nav.is-solid {
  pointer-events: auto;
}

.site-nav.is-overlay {
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.site-nav.is-overlay .hero-nav__logo {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.site-nav.is-overlay .hero-nav__menu > li > a,
.site-nav.is-overlay .nav-dropdown__trigger {
  color: rgba(255, 255, 255, 0.92);
}

.site-nav.is-solid {
  padding: 20px 32px;
  background: var(--color-white);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .site-nav.is-solid {
  background: #1e1e1e;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
}

.site-nav.is-solid .hero-nav__logo {
  color: var(--color-text-dark);
  text-shadow: none;
}

.site-nav.is-solid .hero-nav__menu a {
  color: var(--color-text);
}

.site-nav .hero-nav__logo,
.site-nav .hero-nav__menu a,
.site-nav .hero-nav__menu i {
  transition: color 0.3s ease, text-shadow 0.3s ease;
}

.hero-nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.hero-nav__logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
}

.hero-nav__logo-text {
  line-height: 1;
}

.hero-nav__menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* NotionNext menu-link：底部主题色下划线展开 */
.menu-link {
  text-decoration: none;
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 0 2px;
  transition: background-size 0.1s ease-in-out, color 0.15s ease;
}

.site-nav .hero-nav__menu > li {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.site-nav .menu-link,
.site-nav .nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 0 4px;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-nav .menu-link:hover,
.site-nav .hero-nav__menu > li > a:hover {
  color: var(--color-primary);
  background-size: 100% 2px;
}

.site-nav .hero-nav__menu > li > a:hover i {
  color: var(--color-primary);
}

.hero-nav__menu i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  transition: color 0.15s ease;
}

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

.nav-dropdown__menu .nav-icon--image {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 6px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__trigger {
  border: none;
  background: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.site-nav.is-solid .nav-dropdown__trigger {
  color: var(--color-text);
}

.nav-dropdown__trigger:hover,
.nav-dropdown.is-open .nav-dropdown__trigger {
  color: var(--color-primary);
}

.nav-dropdown__trigger:hover i,
.nav-dropdown.is-open .nav-dropdown__trigger i {
  color: var(--color-primary);
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 120;
}

[data-theme="dark"] .nav-dropdown__menu {
  background: #1e1e1e;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown.is-open .nav-dropdown__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text);
  text-shadow: none;
  text-decoration: none;
  background-image: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown__menu a:hover {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  background-size: 0;
}

.nav-dropdown__menu a i {
  width: 16px;
  text-align: center;
  color: var(--color-primary);
  opacity: 0.85;
}

.icon-mr {
  margin-right: 6px;
}

.hero__center {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  text-align: center;
  color: #fff;
}

.hero__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  margin-bottom: 12px;
}

.hero__subtitle {
  max-width: min(680px, 92vw);
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero__typed-line {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-bottom: 40px;
  font-size: 18px;
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero-typed {
  display: inline;
}

.hero-typed-cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 300;
  animation: hero-cursor-blink 1s step-end infinite;
}

@keyframes hero-cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .post-card {
    opacity: 1;
    transform: none;
    will-change: auto;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .hero-typed-cursor {
    animation: none;
  }
}

.hero-categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 900px;
}

.hero-categories a {
  padding: 18px 12px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  border: 2px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, border-color 0.25s;
}

.hero-categories a:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: opacity 0.2s;
}

.hero-scroll:hover {
  opacity: 0.75;
}

.hero-scroll__arrow {
  display: inline-flex;
  font-size: 16px;
  animation: hero-scroll-bounce 2s ease-in-out infinite;
}

@keyframes hero-scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ========== 主体两栏布局 ========== */
.page-wrap {
  padding: 40px 24px 24px;
}

.page-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 32px;
  align-items: start;
}

/* ========== 文章卡片（NotionNext 杂志风） ========== */
.post-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#post-feed-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post-card {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  height: var(--card-height);
  padding: 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 50px, 0);
  transition:
    opacity 0.5s ease-in-out,
    transform 0.5s ease-in-out,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  will-change: opacity, transform;
}

.post-card.is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 奇数卡片：文字左、图右；偶数卡片：图左、文字右（对齐 blog.rahc.top） */
.post-card:nth-child(even) {
  flex-direction: row-reverse;
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(146, 140, 238, 0.35);
}

[data-theme="dark"] .post-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border-color: rgba(146, 140, 238, 0.45);
}

.post-card__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.post-card__title {
  font-size: 20px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-text-light);
}

.post-card__title a {
  display: inline;
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(var(--color-primary), var(--color-primary));
  background-repeat: no-repeat;
  background-position: bottom left;
  background-size: 0 2px;
  transition: background-size 0.2s ease-in-out, color 0.2s ease;
  padding-bottom: 2px;
}

.post-card:hover .post-card__title a,
.post-card__title a:hover {
  color: var(--color-link);
}

.post-card__title a:hover {
  background-size: 100% 2px;
}

.post-card__title .leaf {
  margin-right: 4px;
}

.post-card__category {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.post-card__category i {
  font-size: 13px;
  flex-shrink: 0;
}

.post-card__excerpt {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: auto;
  min-width: 0;
}

.post-card__date {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.post-card__date i {
  font-size: 13px;
}

.post-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

.tag {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--color-text-light);
  border-radius: var(--radius-sm);
}

.tag--yellow { background: var(--color-tag-yellow); }
.tag--pink   { background: var(--color-tag-pink); }
.tag--blue   { background: var(--color-tag-blue); }
.tag--green  { background: var(--color-tag-green); }

.post-card__thumb {
  flex: 0 0 40%;
  max-width: 40%;
  overflow: hidden;
  display: block;
  position: relative;
  border-radius: var(--radius-md);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 0.5s ease;
  will-change: transform;
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.1);
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-bottom: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.pagination a {
  color: var(--color-primary);
  text-decoration: underline;
}

.pagination a.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.pagination a.is-active:hover {
  background: var(--color-primary-hover);
}

.pagination a:hover:not(.is-active) {
  opacity: 0.7;
}

/* ========== 侧栏 ========== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 24px;
}

.sidebar-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.author-card {
  text-align: center;
  padding: 24px 20px 28px;
  transition: box-shadow 0.2s ease;
}

.author-card:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .author-card:hover {
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
}

.author-card__avatar-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0 8px;
  cursor: pointer;
}

.author-card__avatar-wrap:hover .author-card__avatar {
  transform: rotate(12deg) scale(1.04);
}

.author-card__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.author-card__name {
  font-size: 20px;
  font-weight: 500;
  color: var(--color-text-dark);
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.author-card__role {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 8px;
  line-height: 1.6;
}

.author-stats {
  display: flex;
  justify-content: center;
  width: 100%;
  line-height: 2;
  margin: 8px 0 20px;
}

.author-stats__item {
  flex: 1;
  max-width: 88px;
  padding: 6px 8px;
  color: var(--color-text);
  transition: transform 0.2s ease, color 0.2s ease;
}

.author-stats__item:hover {
  color: #4f46e5;
  transform: scale(1.05);
}

[data-theme="dark"] .author-stats__item:hover {
  color: #818cf8;
}

.author-stats__label {
  display: block;
  font-size: 14px;
  text-align: center;
}

.author-stats__num {
  display: block;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-dark);
}

.author-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 20px;
  color: var(--color-text-light);
}

.author-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: inherit;
  transition: transform 0.15s ease, color 0.2s ease;
}

.author-social a:hover {
  color: #4f46e5;
  transform: scale(1.25);
}

[data-theme="dark"] .author-social a:hover {
  color: #818cf8;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 16px;
}

/* Latest posts（对齐 NotionNext hexo 侧栏） */
.latest-posts__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 4px;
}

.latest-posts__title i {
  font-size: 13px;
  color: var(--color-text-muted);
}

.latest-posts__item {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 2px 0;
  transition: opacity 0.2s;
}

.latest-posts__item:hover {
  opacity: 0.88;
}

.latest-posts__item:hover .latest-posts__name {
  color: var(--color-primary);
}

.latest-posts__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-border);
}

.latest-posts__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.latest-posts__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 4px;
}

.latest-posts__name {
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-link);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.latest-posts__date {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

[data-theme="dark"] .latest-posts__name {
  color: var(--color-text);
}

[data-theme="dark"] .latest-posts__item:hover .latest-posts__name {
  color: var(--color-primary-hover);
}

/* ========== 页脚（对齐 NotionNext hexo footer） ========== */
.site-footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  padding: 24px 24px 20px;
  background: var(--color-footer-bg);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-text-light);
  flex-shrink: 0;
}

[data-theme="dark"] .site-footer {
  background: #000;
  color: var(--color-text);
}

.site-footer__inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-footer__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.site-footer__copyright {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  color: inherit;
}

.site-footer__year {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.site-footer__year i {
  font-size: 13px;
}

.site-footer__sep {
  color: var(--color-text-muted);
  user-select: none;
}

.site-footer__author-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.site-footer__author-link:hover {
  color: var(--color-primary);
}

.site-footer__heart {
  color: #ef4444;
  font-size: 13px;
  animation: footer-heart-pulse 2s ease-in-out infinite;
}

@keyframes footer-heart-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

.site-footer__stats {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.site-footer__stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: inherit;
}

.site-footer__stat i {
  font-size: 12px;
  opacity: 0.85;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  width: 100%;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

[data-theme="dark"] .site-footer__legal {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.site-footer__beian-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.site-footer__beian-link:hover {
  color: var(--color-primary);
}

.site-footer__beian-link--psb i {
  font-size: 11px;
  opacity: 0.75;
}

.site-footer__tagline {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.site-footer__powered {
  margin: 8px 0 0;
  font-size: 14px;
  font-family: Georgia, "Times New Roman", serif;
}

.catalog__header i {
  font-size: 14px;
}

/* ========== 浮动工具栏 ========== */
.float-tools {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.float-tools.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.float-tools__bar {
  display: flex;
  flex-direction: column;
  background: var(--color-primary);
  border-radius: 20px;
  padding: 8px 6px;
  gap: 4px;
}

.float-tools__btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
  padding: 0;
  text-decoration: none;
}

.float-tools__btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.08);
}

.float-tools__btn.is-active {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== 文章详情页 ========== */
.article-hero {
  position: relative;
  height: 384px;
  min-height: 280px;
  overflow: hidden;
}

.article-hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.article-hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.7);
}

.article-hero__center {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 24px 48px;
  text-align: center;
  color: #fff;
}

.article-hero__category {
  display: inline-block;
  padding: 6px 16px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.15);
}

.article-hero__title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.45;
  max-width: 860px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}

.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 18px;
}

.article-hero__meta a {
  color: rgba(255, 255, 255, 0.88);
  transition: opacity 0.2s;
}

.article-hero__meta a:hover {
  opacity: 0.75;
}

.article-hero__meta i {
  font-size: 12px;
  opacity: 0.9;
}

.article-hero__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.article-hero__tags .tag {
  color: var(--color-text-light);
  transition: opacity 0.2s;
}

.article-hero__tags .tag:hover {
  opacity: 0.85;
}

/* 详情页主体布局（与 Hero 分离，不重叠） */
.article-page {
  position: relative;
  z-index: 2;
  padding: 32px 20px 48px;
}

.article-page__inner {
  max-width: 1320px;
  margin: 0 auto;
}

.article-page__row {
  display: flex;
  gap: 24px;
  align-items: stretch;
}

/* 左侧目录（sticky；父列与正文同高，滚动全程可见） */
.article-page__catalog {
  flex: 0 0 var(--catalog-width);
  width: var(--catalog-width);
  align-self: stretch;
}

.article-page__catalog .catalog {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
}

body.has-site-nav-solid .article-page__catalog .catalog {
  top: 64px;
  max-height: calc(100vh - 88px);
}

.article-page__catalog .sidebar-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .article-page__catalog .sidebar-card {
  box-shadow: none;
}

.article-page__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.article-page__aside {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 文章单卡片 */
.article-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .article-card {
  box-shadow: none;
}

.article-page__aside .sidebar-card {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .article-page__aside .sidebar-card {
  box-shadow: none;
}

/* 正文 */
.article-body {
  padding: 28px 32px 36px;
  font-size: 15px;
  line-height: 1.85;
  color: var(--color-text);
}

.article-body p {
  margin-bottom: 16px;
}

.article-body h2 {
  font-size: 1.35em;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 36px 0 16px;
  padding-top: 4px;
}

.article-body h3 {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--color-text-dark);
  margin: 28px 0 12px;
}

.article-body a {
  color: var(--color-link);
  text-decoration: underline;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

.article-body ul,
.article-body ol {
  margin: 0 0 16px 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body :not(pre) > code {
  padding: 2px 6px;
  font-size: 0.88em;
  font-family: ui-monospace, Consolas, monospace;
  background: #fce8e8;
  color: #c0392b;
  border-radius: 3px;
}

.article-body pre code {
  padding: 0;
  background: none;
  color: inherit;
  border-radius: 0;
  font-size: inherit;
}

[data-theme="dark"] .article-body :not(pre) > code {
  background: #3d2020;
  color: #f0a0a0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.article-body th,
.article-body td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.article-body td:first-child {
  white-space: normal;
  min-width: 180px;
}

.article-body th {
  background: var(--color-table-head);
  font-weight: 600;
  color: var(--color-text-dark);
}

.article-body strong {
  color: var(--color-text-dark);
}

/* 代码块（对齐 md-editor-v3 预览） */
.md-editor-code {
  position: relative;
  margin: 20px 0;
  font-size: 12px;
  line-height: 1;
  color: var(--code-text);
}

.md-editor-code-head {
  display: grid;
  grid-template: "1fr 1fr";
  justify-content: space-between;
  width: 100%;
  height: 32px;
  margin-block-end: 0;
  background-color: var(--code-head-bg);
  border-start-start-radius: var(--code-radius);
  border-start-end-radius: var(--code-radius);
  font-size: 12px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 10000;
  -webkit-tap-highlight-color: transparent;
}

.md-editor-code-head::-webkit-details-marker {
  display: none;
}

details.md-editor-code:not([open]) .md-editor-code-head {
  border-end-start-radius: var(--code-radius);
  border-end-end-radius: var(--code-radius);
}

details.md-editor-code[open] .md-editor-code-head {
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}

.md-editor-code-flag {
  margin-inline-start: 12px;
}

.md-editor-code-flag span {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-block-start: 11px;
  border-radius: 50%;
}

.md-editor-code-flag span + span {
  margin-inline-start: 4px;
}

.md-editor-code-flag span:first-of-type {
  background-color: rgb(236, 106, 94);
}

.md-editor-code-flag span:nth-of-type(2) {
  background-color: rgb(244, 191, 79);
}

.md-editor-code-flag span:nth-of-type(3) {
  background-color: rgb(97, 197, 84);
}

.md-editor-code-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.md-editor-code-action > * {
  margin-inline-end: 10px;
}

.md-editor-code-lang {
  line-height: 32px;
  color: var(--code-lang);
}

.md-editor-copy-button {
  cursor: pointer;
  line-height: 32px;
  position: static;
  color: var(--code-copy);
  transition: color 0.15s ease;
}

.md-editor-copy-button:hover {
  color: var(--code-copy-active);
}

.md-editor-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: sub;
}

.md-editor-collapse-tips {
  margin-inline-end: 12px;
  color: var(--code-lang);
}

.md-editor-collapse-tips .md-editor-icon {
  transition: transform 0.1s;
  transform: rotate(0deg);
}

details.md-editor-code[open] .md-editor-collapse-tips .md-editor-icon {
  transform: rotate(-90deg);
}

.md-editor-code pre {
  margin: 0;
  position: relative;
}

.md-editor-code pre code {
  display: block;
  margin: 0;
  padding: 1em;
  overflow: auto;
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre;
  color: var(--code-text);
  background-color: var(--code-bg) !important;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  border-end-start-radius: var(--code-radius);
  border-end-end-radius: var(--code-radius);
  tab-size: 2;
}

/* 超过 20 行时折叠（借鉴 Hugo Stack code-more） */
.md-editor-code-pre-wrap {
  position: relative;
}

.md-editor-code.is-foldable:not(.is-code-expanded) .md-editor-code-pre-wrap pre code {
  max-height: calc(2em + var(--code-fold-visible-lines, 20) * 1.6em);
  overflow: hidden;
}

.md-editor-code.is-code-expanded .md-editor-code-pre-wrap pre code {
  max-height: none;
  overflow: auto;
}

.code-more-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding-top: 78px;
  background-image: linear-gradient(to bottom, rgba(40, 44, 52, 0), var(--code-bg));
  border-end-start-radius: var(--code-radius);
  border-end-end-radius: var(--code-radius);
  pointer-events: none;
}

[data-theme="dark"] .code-more-box {
  background-image: linear-gradient(to bottom, rgba(26, 26, 26, 0), var(--code-bg));
}

.code-more-btn {
  display: block;
  margin: 0 auto;
  width: 44px;
  height: 22px;
  padding-top: 6px;
  background: #f0f0f5;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  cursor: pointer;
  pointer-events: auto;
}

[data-theme="dark"] .code-more-btn {
  background: #3a3f4b;
}

.code-more-img {
  display: block;
  margin: 0 auto;
  width: 22px;
  height: 16px;
}

.article-tip {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 32px;
  padding: 16px 20px;
  background: var(--color-callout-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.article-tip__icon {
  font-size: 20px;
  flex-shrink: 0;
}

.article-tip p {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-light);
}

.article-info {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text-muted);
}

.article-info ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-info li + li {
  margin-top: 6px;
}

.related-posts {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.related-posts__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 14px;
}

.related-posts__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-posts__list a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--color-link);
  background: var(--color-callout-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
}

.related-posts__list a:hover {
  border-color: var(--color-primary);
  background: var(--color-white);
}

.article-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  padding-bottom: 8px;
}

.article-nav-links a {
  color: var(--color-link);
  max-width: 46%;
  line-height: 1.5;
  transition: opacity 0.2s;
}

.article-nav-links a:hover {
  opacity: 0.75;
}

.article-nav-links i {
  font-size: 11px;
}

/* 目录 Catalog（随侧栏自然滚动，避免遮挡下方作者卡片） */

.catalog__header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.catalog__progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.catalog__progress {
  flex: 1;
  height: 6px;
  background: #4b5563;
  border-radius: 3px;
  overflow: hidden;
}

[data-theme="dark"] .catalog__progress {
  background: #374151;
}

.catalog__progress-bar {
  height: 100%;
  background: #4f46e5;
  border-radius: 3px;
  width: 0%;
  transition: width 0.15s;
}

[data-theme="dark"] .catalog__progress-bar {
  background: #6366f1;
}

.catalog__percent {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 32px;
  text-align: right;
}

.catalog__list {
  list-style: none;
  font-size: 13px;
  line-height: 1.65;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.catalog__list > li {
  margin-bottom: 4px;
}

.catalog__list a {
  display: block;
  padding: 3px 0 3px 10px;
  color: var(--color-link);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  line-height: 1.5;
}

.catalog__list a:hover,
.catalog__list a.is-active {
  border-left-color: var(--color-primary);
  color: var(--color-primary);
}

.catalog__list .catalog__sub {
  list-style: none;
  padding-left: 8px;
  margin: 2px 0 6px;
}

.catalog__list .catalog__sub a {
  font-size: 12px;
  color: var(--color-text-light);
  padding-left: 14px;
}

.catalog__list .catalog__sub a:hover,
.catalog__list .catalog__sub a.is-active {
  color: var(--color-primary);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
  .article-page__catalog {
    display: none;
  }

  .article-page__inner {
    max-width: var(--container-max);
  }
}

@media (max-width: 960px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .article-page__row {
    flex-direction: column;
  }

  .article-page__aside {
    width: 100%;
    flex: none;
  }

  .sidebar {
    position: static;
  }

  .hero-categories {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-nav__menu {
    display: none;
  }
}

@media (max-width: 900px) {
  .post-card {
    align-items: flex-start;
    min-height: 0;
    height: auto;
  }

  .post-card__content {
    gap: 10px;
    justify-content: flex-start;
  }

  .post-card__title {
    font-size: 19px;
    line-height: 1.4;
  }

  .post-card__category,
  .post-card__excerpt {
    margin-top: 6px;
  }

  .post-card__excerpt {
    line-height: 1.55;
  }

  .post-card__tags {
    row-gap: 6px;
    padding-bottom: 1px;
  }

  .post-card__thumb {
    align-self: flex-start;
    height: clamp(144px, 20vw, 176px);
  }
}

@media (max-width: 640px) {
  .post-card,
  .post-card:nth-child(even) {
    flex-direction: row;
    min-height: 148px;
    height: auto;
    gap: 12px;
    padding: 12px;
  }

  .post-card__thumb {
    flex: 0 0 34%;
    max-width: 34%;
    min-height: 124px;
  }

  .post-card__thumb img {
    height: 100%;
  }

  .post-card__content {
    gap: 6px;
  }

  .post-card__title {
    font-size: 16px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .post-card__category,
  .post-card__excerpt {
    margin-top: 4px;
  }

  .post-card__category {
    font-size: 12px;
  }

  .post-card__excerpt {
    font-size: 13px;
    line-height: 1.45;
  }

  .post-card__footer {
    gap: 0;
    margin-top: 6px;
  }

  .post-card__date {
    font-size: 12px;
  }

  .post-card__tags {
    display: none;
  }

  .hero-categories {
    grid-template-columns: 1fr;
  }

  .site-nav {
    padding: 16px 20px;
  }

  .site-nav.is-solid {
    padding: 16px 20px;
  }

  #searchModal {
    width: calc(100% - 32px);
    min-height: 420px;
  }
}

/* ========== 搜索弹窗（参考 Matery / blog.huan99.com） ========== */
.search-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.search-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

#searchModal {
  position: fixed;
  top: 10%;
  left: 50%;
  z-index: 1003;
  width: min(810px, 80%);
  min-height: 500px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #fafafa;
  border-radius: 2px;
  box-shadow:
    0 24px 38px 3px rgba(0, 0, 0, 0.14),
    0 9px 46px 8px rgba(0, 0, 0, 0.12),
    0 11px 15px -7px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) scale(0.92);
  transition:
    opacity 0.3s ease,
    visibility 0.3s,
    transform 0.3s ease;
}

#searchModal.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

[data-theme="dark"] #searchModal {
  background: #2a2a2a;
  box-shadow:
    0 24px 38px 3px rgba(0, 0, 0, 0.45),
    0 9px 46px 8px rgba(0, 0, 0, 0.35),
    0 11px 15px -7px rgba(0, 0, 0, 0.5);
}

#searchModal .modal-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 24px;
}

#searchModal .search-header {
  flex-shrink: 0;
}

#searchModal .search-header .title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-text-dark);
  margin-bottom: 16px;
}

#searchModal .search-header .title i {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

#searchModal .search-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #9e9e9e;
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
  padding: 8px 0;
  color: var(--color-text-dark);
  outline: none;
}

#searchModal .search-input:focus {
  border-bottom-color: var(--color-primary);
}

#searchModal .search-input::placeholder {
  color: var(--color-text-muted);
}

#searchResult {
  flex: 1;
  min-height: 0;
  margin: 8px 0 0;
  overflow-y: auto;
}

#searchResult .search-hint,
#searchResult .search-empty {
  margin: 20px 4px 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

#searchResult .search-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--color-text-light);
}

#searchResult .search-result-list li {
  border-bottom: 1px solid var(--color-border);
  padding: 15px 0 8px;
}

#searchResult .search-result-list li:last-child {
  border-bottom: none;
}

.search-result-list .search-result-title {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 500;
  color: #42b983;
  margin-bottom: 6px;
  transition: opacity 0.2s ease;
}

.search-result-list .search-result-title:hover {
  opacity: 0.85;
}

[data-theme="dark"] .search-result-list .search-result-title {
  color: #5fd4a4;
}

.search-result-list .search-result {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-list .search-keyword {
  margin: 0 2px;
  padding: 1px 5px 1px 4px;
  border-radius: 2px;
  background-color: #f2f2f2;
  color: #e96900;
  font-style: normal;
}

[data-theme="dark"] .search-result-list .search-keyword {
  background-color: #3a3a3a;
  color: #ffb74d;
}

body.search-modal-open {
  overflow: hidden;
}

/* ========== 内页 Banner（标签云 / 分类等） ========== */
.page-banner {
  position: relative;
  height: 280px;
  min-height: 220px;
  overflow: hidden;
}

.page-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.page-banner__shade {
  position: absolute;
  inset: 0;
  background: var(--color-hero-shade);
}

.page-banner__center {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px 48px;
  text-align: center;
  color: #fff;
}

.page-banner__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.page-banner__subtitle {
  margin-top: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.04em;
}

/* ========== 归档页（参考 blog.liushen.fun/archives） ========== */
.archive-page {
  position: relative;
  z-index: 3;
  max-width: 900px;
  margin: -56px auto 64px;
  padding: 0 20px;
}

.archive-container {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  padding: 32px 28px 40px;
}

[data-theme="dark"] .archive-container {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.archive-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.archive-summary__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
}

.archive-summary__item i {
  color: var(--color-primary);
  font-size: 15px;
}

.archive-summary__divider {
  width: 1px;
  height: 16px;
  background: var(--color-border);
}

.archive-timeline {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.archive-container .pagination {
  margin-top: 28px;
  padding-bottom: 0;
}

.archive-empty {
  margin: 0;
  padding: 40px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.archive-year {
  opacity: 0;
  transform: translateY(10px);
  animation: archive-year-reveal 0.5s ease forwards;
  animation-delay: var(--reveal-delay, 0ms);
}

@keyframes archive-year-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.archive-year__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary);
}

.archive-year__title {
  font-size: clamp(26px, 4vw, 32px);
  font-weight: 700;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

.archive-year__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(146, 140, 238, 0.12);
  border-radius: 999px;
}

[data-theme="dark"] .archive-year__count {
  background: rgba(146, 140, 238, 0.2);
}

.archive-year__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-left: 12px;
  border-left: 2px solid var(--color-border);
  margin-left: 6px;
}

.archive-month__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding-left: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-light);
}

.archive-month__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-page);
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.archive-item {
  display: grid;
  grid-template-columns: 40px 100px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.archive-item:hover {
  background: rgba(146, 140, 238, 0.06);
}

[data-theme="dark"] .archive-item:hover {
  background: rgba(146, 140, 238, 0.1);
}

.archive-item__day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  background: rgba(146, 140, 238, 0.1);
  border-radius: 10px;
  flex-shrink: 0;
  align-self: center;
}

.archive-item__thumb {
  flex-shrink: 0;
  width: 100px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
}

.archive-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.archive-item:hover .archive-item__thumb img {
  transform: scale(1.06);
}

.archive-item__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.archive-item__title .menu-link {
  display: inline;
  padding-bottom: 2px;
  color: var(--color-text-light);
}

.archive-item:hover .archive-item__title .menu-link,
.archive-item__title .menu-link:hover {
  color: var(--color-link);
  background-size: 100% 2px;
}

.archive-item__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-muted);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.archive-item:hover .archive-item__excerpt,
.archive-item__excerpt:hover {
  color: var(--color-text);
}

@media (max-width: 640px) {
  .archive-page {
    margin-top: -40px;
    padding: 0 14px;
  }

  .archive-container {
    padding: 24px 18px 32px;
  }

  .archive-year__body {
    padding-left: 8px;
    margin-left: 4px;
  }

  .archive-item {
    grid-template-columns: 32px 80px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 8px 12px 12px;
  }

  .archive-item__day {
    width: 32px;
    height: 32px;
    font-size: 12px;
    border-radius: 8px;
  }

  .archive-item__thumb {
    width: 80px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive-year {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ========== 标签云（参考 blog.huan99.com Matery chip） ========== */
.chip-container {
  position: relative;
  z-index: 3;
  width: min(900px, calc(100% - 40px));
  max-width: 900px;
  margin: -56px auto 48px;
  padding: 0 20px;
  box-sizing: border-box;
}

.chip-container__card {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  padding: 32px 28px 36px;
}

[data-theme="dark"] .chip-container__card {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.chip-container__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--color-text-dark);
  text-align: center;
}

.chip-container__title i {
  color: var(--color-text-muted);
  font-size: 1.25rem;
}

.tag-chips {
  margin: 1rem auto 0.5rem;
  max-width: 850px;
  text-align: center;
}

.tag-chips a {
  text-decoration: none;
  display: inline-block;
}

.tag-chips .chip {
  margin: 10px;
  padding: 18px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  box-sizing: border-box;
  line-height: 1;
  font-size: 1rem;
  font-weight: 500;
  color: var(--chip-color, #34495e);
  border-radius: 5px;
  cursor: pointer;
  background-color: var(--chip-bg, #eef2f7);
  border: 1px solid transparent;
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.12);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tag-chips .chip:hover {
  color: #fff;
  background: linear-gradient(to right, #4cbf30 0%, #0f9d58 100%) !important;
  box-shadow: 0 6px 14px rgba(76, 191, 48, 0.35);
  transform: translateY(-1px);
}

.tag-chips .chip:hover .tag-length {
  color: #fff;
}

.tag-chips .chip-active {
  color: #fff !important;
  background: linear-gradient(to bottom right, #FF5E3A 0%, #FF2A68 100%) !important;
  box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.18) !important;
}

.tag-chips .chip-active .tag-length {
  color: #fff;
}

.tag-chips .tag-length {
  margin-left: 6px;
  min-width: 1.25em;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--chip-count-color, #e91e63);
  vertical-align: super;
}

/* 暗色：保持 Matery 方块 chip 风格，底色由 BLOG_TAG_COLORS_DARK 提供 */
[data-theme="dark"] .tag-chips .chip.chip-default {
  color: var(--chip-color, #f1f5f9);
  background-color: var(--chip-bg) !important;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .tag-chips .chip.chip-default .tag-length {
  color: var(--chip-count-color, #ff8ab5);
}

.hero-nav__menu a.is-active {
  color: var(--color-primary);
}

/* 标签对应文章列表（对齐首页 post-card / 侧栏 latest-posts） */
.tags-posts {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.tags-posts.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tags-posts__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.tags-posts__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  background: rgba(146, 140, 238, 0.12);
  border-radius: 999px;
}

[data-theme="dark"] .tags-posts__badge {
  background: rgba(146, 140, 238, 0.2);
}

.tags-posts__count {
  font-size: 13px;
  color: var(--color-text-muted);
}

.tags-posts__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
}

.tags-posts__empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
}

.tags-post {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(8px);
  animation: tags-post-reveal 0.45s ease forwards;
  animation-delay: var(--reveal-delay, 0ms);
  transition: background-color 0.2s ease;
}

.tags-post:last-child {
  border-bottom: none;
}

.tags-post:hover {
  background: rgba(146, 140, 238, 0.06);
}

[data-theme="dark"] .tags-post:hover {
  background: rgba(146, 140, 238, 0.1);
}

.tags-post__thumb {
  flex-shrink: 0;
  width: 112px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
}

.tags-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tags-post:hover .tags-post__thumb img {
  transform: scale(1.06);
}

.tags-post__main {
  min-width: 0;
}

.tags-post__title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 6px;
}

.tags-post__title .menu-link {
  display: inline;
  padding-bottom: 2px;
  color: var(--color-text-light);
}

.tags-post:hover .tags-post__title .menu-link,
.tags-post__title .menu-link:hover {
  color: var(--color-link);
  background-size: 100% 2px;
}

.tags-post__title .leaf {
  margin-right: 2px;
}

.tags-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.tags-post__meta span {
  display: inline-flex;
  align-items: center;
}

.tags-post__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-muted);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.tags-post:hover .tags-post__excerpt,
.tags-post__excerpt:hover {
  color: var(--color-text);
}

.tags-post__arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--color-text-muted);
  background: var(--color-page);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.tags-post:hover .tags-post__arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--color-primary);
  background: rgba(146, 140, 238, 0.12);
}

@keyframes tags-post-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tags-posts {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .tags-post {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .tags-post__arrow {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .tags-post {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .tags-post__thumb {
    width: 88px;
    height: 60px;
  }

  .tags-post__arrow {
    display: none;
  }

  .tags-post__title {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .chip-container {
    margin-top: -40px;
    padding: 0 16px;
  }

  .chip-container__card {
    padding: 24px 16px 28px;
  }

  .chip-container__title {
    font-size: 1.35rem;
  }

  .tag-chips .chip {
    margin: 8px 6px;
    padding: 14px 12px;
    min-width: 92px;
    font-size: 0.9rem;
  }
}

/* ── Categories page ── */
.category-intro {
  margin: -8px 0 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.category-card {
  --category-accent: #928cee;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 178px;
  box-sizing: border-box;
  padding: 22px 20px;
  text-align: left;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--category-accent);
  opacity: 0.85;
  transition: height 0.25s ease;
}

.category-card:hover {
  border-color: color-mix(in srgb, var(--category-accent) 40%, var(--color-border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.category-card.is-active {
  border-color: var(--category-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--category-accent) 25%, transparent),
    0 10px 28px rgba(0, 0, 0, 0.08);
}

.category-card.is-active::before {
  height: 4px;
}

[data-theme="dark"] .category-card {
  background: var(--color-card);
}

[data-theme="dark"] .category-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.category-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 18px;
  color: var(--category-accent);
  background: color-mix(in srgb, var(--category-accent) 14%, transparent);
}

.category-card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-light);
  line-height: 1.4;
}

.category-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.category-card__count {
  margin-top: auto;
  min-width: 86px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--category-accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--category-accent) 12%, transparent);
}

/* ── About page ── */
.about-page {
  max-width: var(--content-max, 1100px);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.about-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.about-profile {
  position: sticky;
  top: 88px;
  text-align: center;
  padding: 28px 20px 24px;
}

.about-profile__name {
  margin: 12px 0 4px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-text-light);
}

.about-profile__role {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.about-profile__tagline {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-muted);
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-card {
  padding: 24px 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
}

[data-theme="dark"] .about-card {
  background: var(--color-card);
}

.about-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-light);
}

.about-card__title i {
  color: var(--color-primary);
}

.about-bio p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-friends-intro {
  margin: -4px 0 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-text-muted);
}

.about-friends {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.friend-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-page);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.friend-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-page));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

[data-theme="dark"] .friend-card {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .friend-card:hover {
  background: color-mix(in srgb, var(--color-primary) 10%, rgba(255, 255, 255, 0.03));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.friend-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.friend-card__avatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.friend-card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.friend-card__body strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-light);
}

.friend-card__desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.friend-card__url {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
}

.friend-card__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--color-primary);
  background: rgba(146, 140, 238, 0.12);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.friend-card:hover .friend-card__arrow {
  opacity: 1;
  transform: translateX(0);
}

.friend-card:hover .friend-card__body strong {
  color: var(--color-primary);
}

.about-card--quote {
  background: linear-gradient(135deg, rgba(146, 140, 238, 0.08), rgba(99, 102, 241, 0.04));
  border-color: color-mix(in srgb, var(--color-primary) 20%, var(--color-border));
}

[data-theme="dark"] .about-card--quote {
  background: linear-gradient(135deg, rgba(146, 140, 238, 0.12), rgba(99, 102, 241, 0.06));
}

.about-quote {
  margin: 0;
}

.about-quote p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.75;
  font-style: italic;
  color: var(--color-text-light);
}

.about-quote footer {
  font-size: 13px;
  color: var(--color-text-muted);
}

@media (max-width: 900px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-profile {
    position: static;
  }
}
