/* ==========================================================================
   墨白 Ink — Halo 主题
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

:root {
  --bg: #fbf9f4;
  --bg-elev: #ffffff;
  --bg-soft: #f3efe6;
  --text: #1d1f21;
  --text-soft: #4a4f55;
  --muted: #8b8f94;
  --border: #e6dfd2;
  --border-strong: #d5ccba;
  --accent: var(--accent-base, #b45309);
  --accent-contrast: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --shadow-sm: 0 1px 2px rgba(31, 35, 40, 0.05);
  --shadow-md: 0 18px 40px -24px rgba(31, 35, 40, 0.32);
  --radius: 14px;
  --radius-sm: 8px;
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia,
    "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono",
    Menlo, monospace;
  --width: 1080px;
  --width-text: 720px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #131312;
  --bg-elev: #1a1a19;
  --bg-soft: #20201e;
  --text: #e9e6df;
  --text-soft: #b9b5ad;
  --muted: #8d8981;
  --border: #2b2b27;
  --border-strong: #3b3a35;
  --accent: color-mix(in srgb, var(--accent-base, #b45309) 74%, #ffffff);
  --accent-contrast: #1a1a19;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 20px 44px -24px #000000;
}

html[data-title-font="sans"] {
  --font-display: var(--font-body);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--accent);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 28px;
}

.container-narrow {
  max-width: var(--width-text);
}

.site-main {
  min-height: 60vh;
  padding-bottom: 96px;
}

/* 阅读进度 */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* 顶部导航 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: inline-block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-soft);
  border-radius: 999px;
  transition: color 0.18s ease, background-color 0.18s ease;
}

.nav-link:hover,
.nav-item:hover > .nav-link {
  color: var(--text);
  background: var(--bg-soft);
}

.sub-nav {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 168px;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.sub-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-soft);
  border-radius: 8px;
  white-space: nowrap;
}

.sub-nav a:hover {
  background: var(--bg-soft);
  color: var(--text);
}

@media (hover: hover) {
  .nav-item.has-sub:hover .sub-nav {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.header-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* 行内搜索：从按钮左侧展开 */
.search-box {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 0;
  opacity: 0;
  overflow: visible;
  pointer-events: none;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

body.search-open .search-box {
  width: 248px;
  opacity: 1;
  pointer-events: auto;
}

.search-form-inline {
  display: flex;
  overflow: hidden;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 5px 0 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.search-form-inline input {
  flex: 1;
  min-width: 0;
  padding: 0;
  font-size: 14px;
  background: transparent;
  border: 0;
  outline: none;
}

.search-form-inline button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 0;
  border-radius: 50%;
}

.search-form-inline button[type="submit"] svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.search-toggle[aria-expanded="true"] {
  color: var(--text);
  background: var(--bg-soft);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: min(380px, 60vh);
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.search-results.is-open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.search-hit:hover,
.search-hit.is-active {
  background: var(--bg-soft);
}

.search-hit-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.search-hit-desc {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-hit mark {
  padding: 0 2px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
}

.search-empty-inline {
  margin: 0;
  padding: 20px 12px;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.menu-btn {
  display: none;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 12, 12, 0.42);
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* 首页 */
.home {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58vh;
  padding: 72px 0 96px;
}

.home .container {
  max-width: var(--width-text);
  padding-top: 0;
  text-align: center;
}

.home-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-intro-avatar {
  width: 96px;
  height: 96px;
  margin-bottom: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.home-intro-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.025em;
}

.home-intro-desc {
  max-width: 540px;
  margin: 20px auto 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 38px;
}

.home-link {
  padding: 9px 20px;
  font-size: 14px;
  color: var(--text-soft);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

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

/* 文章列表 */
.post-list {
  margin-top: 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-more {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.18s ease;
}

.section-more span {
  display: inline-block;
  transition: transform 0.18s ease;
}

.section-more:hover span {
  transform: translateX(3px);
}

.post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 36px;
  padding: 34px 0;
  border-bottom: 1px solid var(--border);
}

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

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
}

.post-card-title {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.post-card-title a {
  transition: color 0.18s ease;
}

.post-card-excerpt {
  margin: 12px 0 0;
  font-size: 14.5px;
  line-height: 1.78;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--bg-soft);
  border-radius: 999px;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.tag::before {
  content: "#";
  margin-right: 2px;
  opacity: 0.45;
}

.tag:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.post-card-cover {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-soft);
  aspect-ratio: 3 / 2;
  align-self: center;
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card-cover:hover img {
  transform: scale(1.04);
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 44px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: 13.5px;
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

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

.pagination-gap {
  flex: 1;
}

/* 空状态 */
.empty-state {
  padding: 88px 24px;
  text-align: center;
}

.empty-mark {
  margin: 0;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  color: var(--border-strong);
}

.empty-text {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* 页面头部 */
.page-head {
  padding: 72px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.page-kicker {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-desc {
  margin: 14px 0 0;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 640px;
}

.page-back {
  font-size: 13.5px;
  color: var(--muted);
}

.author-head {
  display: flex;
  align-items: center;
  gap: 24px;
}

.author-head-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* 归档 */
.archive {
  padding-top: 56px;
}

.archive-year + .archive-year {
  margin-top: 56px;
}

.archive-year-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--border-strong);
}

.archive-month {
  margin-top: 26px;
}

.archive-month-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.archive-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.archive-list time {
  flex-shrink: 0;
  width: 48px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.archive-list a {
  font-size: 15px;
  color: var(--text-soft);
  transition: color 0.18s ease;
}

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

/* 分类 */
.category-tree {
  padding-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.category-card {
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.category-card-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.category-card-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.category-card-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.category-card-desc {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.category-children {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.category-children .category-tree {
  padding-top: 0;
  grid-template-columns: 1fr;
  gap: 8px;
}

.category-children .category-card {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.category-children .category-card:hover {
  transform: none;
  box-shadow: none;
}

.category-children .category-card-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
}

/* 标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 44px;
}

.tag-lg {
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.tag-lg::before {
  content: none;
}

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

.tag-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* 友情链接 */
.link-group {
  padding-top: 44px;
}

.link-group-title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.link-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.link-logo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-soft);
}

.link-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-name {
  font-size: 15px;
  font-weight: 600;
}

.link-desc {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 瞬间 */
.moments {
  padding-top: 44px;
  max-width: 760px;
}

.moment-card {
  padding: 26px;
  margin-bottom: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.moment-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.moment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.moment-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.moment-author {
  font-size: 14px;
  font-weight: 600;
}

.moment-meta time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

.moment-content {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-soft);
}

.moment-content p {
  margin: 0 0 0.7em;
}

.moment-content p:last-child {
  margin-bottom: 0;
}

.moment-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.moment-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.moment-media img,
.moment-media video {
  width: 100%;
  height: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 10px;
}

/* 相册 */
.photo-grid {
  padding-top: 44px;
  columns: 3 240px;
  column-gap: 16px;
}

.photo-card {
  margin: 0 0 16px;
  break-inside: avoid;
}

.photo-link {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-soft);
}

.photo-link img {
  width: 100%;
  transition: transform 0.45s ease;
}

.photo-link:hover img {
  transform: scale(1.03);
}

.photo-caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 2px 0;
  font-size: 13px;
  color: var(--text-soft);
}

.photo-desc {
  font-size: 12px;
  color: var(--muted);
}

/* 搜索 */
.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 36px;
  padding: 6px 6px 6px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 15px;
}

.search-submit {
  flex-shrink: 0;
  padding: 10px 22px;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.search-summary {
  margin: 30px 0 6px;
  font-size: 13.5px;
  color: var(--muted);
}

.search-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-result {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.search-result-title {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.search-result-desc {
  display: block;
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-empty {
  padding: 64px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* 文章详情 */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--width-text)) 200px;
  gap: 72px;
  justify-content: center;
  padding-top: 64px;
}

.post {
  min-width: 0;
}

.post-head {
  margin-bottom: 34px;
}

.post-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.post-kicker a {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}

.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

.post-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.post-cover {
  margin: 0 0 40px;
  border-radius: var(--radius);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
}

.page-detail .post-head {
  margin-bottom: 28px;
}

/* 正文排版 */
.prose {
  font-size: 17px;
  line-height: 1.88;
  color: var(--text);
  overflow-wrap: break-word;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.45em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.prose h2 {
  margin: 2.2em 0 0.8em;
  font-size: 1.62em;
}

.prose h3 {
  margin: 1.9em 0 0.7em;
  font-size: 1.28em;
}

.prose h4 {
  margin: 1.7em 0 0.6em;
  font-size: 1.08em;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose strong {
  font-weight: 650;
  color: var(--text);
}

.prose ul,
.prose ol {
  margin: 0 0 1.45em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0.35em 0;
}

.prose li > ul,
.prose li > ol {
  margin: 0.35em 0;
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 16px 22px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-soft);
  color: var(--text-soft);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.prose pre {
  position: relative;
  margin: 1.8em 0;
  padding: 20px 22px;
  overflow-x: auto;
  background: #17181a;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.68;
  color: #e6e6e6;
  -webkit-overflow-scrolling: touch;
}

.prose pre code {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: #c9c9c9;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.prose pre:hover .code-copy,
.code-copy:focus-visible {
  opacity: 1;
}

.code-copy:hover {
  background: rgba(255, 255, 255, 0.16);
}

.prose table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 14px;
}

.prose th,
.prose td {
  padding: 9px 12px;
  border: 1px solid var(--border);
  text-align: left;
}

.prose th {
  background: var(--bg-soft);
  font-weight: 600;
}

.prose img {
  margin: 1.8em auto;
  border-radius: 10px;
  cursor: zoom-in;
}

.prose hr {
  margin: 2.4em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose figure {
  margin: 1.8em 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  text-align: center;
  color: var(--muted);
}

.prose kbd {
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 0.82em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-elev);
}

.prose details {
  margin: 1.5em 0;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.prose summary {
  cursor: pointer;
  font-weight: 600;
}

/* 文章尾部 */
.post-end {
  margin-top: 44px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

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

.post-copyright {
  margin-top: 26px;
  padding: 18px 20px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-soft);
}

.post-copyright-text {
  margin: 0;
}

.post-copyright-link {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  word-break: break-all;
}

.post-copyright-link a {
  color: var(--muted);
}

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

.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.post-nav-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.post-nav-item.next {
  text-align: right;
}

.post-nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.post-nav-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.post-nav-item.next .post-nav-title {
  order: 2;
}

.post-nav-item.next .post-nav-label {
  order: 1;
}

.author-card {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 38px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.author-avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.author-info {
  min-width: 0;
}

.author-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.author-bio {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}

.comments {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

/* 目录 */
.toc {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 40px);
  max-height: calc(100vh - var(--header-h) - 80px);
  overflow-y: auto;
  padding-left: 18px;
  border-left: 1px solid var(--border);
  scrollbar-width: thin;
}

.toc.is-empty {
  display: none;
}

.toc-title {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-list {
  display: flex;
  flex-direction: column;
}

.toc-link {
  padding: 5px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  transition: color 0.18s ease;
}

.toc-link.toc-level-3 {
  padding-left: 12px;
  font-size: 12px;
}

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

.toc-link.is-active {
  color: var(--accent);
}

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 60px 0 34px;
  background: var(--bg);
}

.footer-inner,
.footer-bottom,
.footer-halo {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 28px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 40px;
}

.footer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.footer-text {
  margin: 10px 0 0;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-line;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-content: flex-start;
}

.footer-links a {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.18s ease;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.footer-copy {
  margin: 0;
}

.footer-beian {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
}

.footer-beian a {
  color: var(--muted);
}

.footer-halo {
  margin-top: 18px;
  padding-top: 0;
  font-size: 12px;
  color: var(--muted);
}

.footer-halo:empty {
  display: none;
}

/* 返回顶部 */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text-soft);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s,
    border-color 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.to-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 404 */
.error-page {
  padding: 120px 0 140px;
  text-align: center;
}

.error-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 10rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--border-strong);
}

.error-title {
  margin: 28px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.error-desc {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.button:hover {
  color: var(--accent-contrast);
  opacity: 0.88;
}

.button-ghost {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--border);
}

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

/* 图片灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(8, 8, 8, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 响应式 */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: minmax(0, var(--width-text));
    gap: 0;
  }

  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 58px;
  }

  .header-inner {
    gap: 16px;
    padding: 0 20px;
  }

  .menu-btn {
    display: inline-flex;
  }

  body.search-open .brand {
    flex-shrink: 1;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body.search-open .search-box {
    width: min(300px, calc(100vw - 200px));
  }

  .search-results {
    position: fixed;
    top: calc(var(--header-h) + 10px);
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 84px 20px 32px;
    overflow-y: auto;
    background: var(--bg-elev);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.nav-open .site-nav {
    transform: translateX(0);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
  }

  .nav-link {
    display: block;
    padding: 11px 12px;
    font-size: 15px;
  }

  .sub-nav {
    position: static;
    min-width: 0;
    margin: 2px 0 6px 12px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .sub-nav a {
    padding: 7px 12px;
    font-size: 13.5px;
  }

  .home {
    padding: 48px 0 72px;
  }

  .home-intro-avatar {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
  }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 28px 0;
  }

  .post-card-cover {
    order: -1;
    aspect-ratio: 16 / 9;
  }

  .post-title {
    font-size: clamp(1.8rem, 6vw, 2.3rem);
  }

  .post-layout {
    padding-top: 44px;
  }

  .page-head {
    padding: 52px 0 28px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 26px;
  }

  .footer-bottom {
    margin-top: 36px;
  }

  .photo-grid {
    columns: 2 200px;
  }

  .container {
    padding: 0 20px;
  }

  .footer-inner,
  .footer-bottom,
  .footer-halo {
    padding: 0 20px;
  }
}

@media (max-width: 560px) {
  .post-card-title {
    font-size: 20px;
  }

  .post-card-cover {
    display: none;
  }

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

  .post-nav-item.next {
    text-align: left;
  }

  .author-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .moment-card {
    padding: 20px;
  }

  .moment-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-grid {
    columns: 1;
  }

  .archive-year-title {
    font-size: 30px;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
  }

  .button {
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
