/* =========================================================
   cangwu的小博客 · 主题样式
   改颜色只需要动下面 :root 里的变量
   ========================================================= */

:root {
  --bg: #f7f6f3;
  --bg-soft: #f0efea;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --text: #1b1c1e;
  --text-soft: #55595f;
  --text-mute: #8b9097;
  --border: #e6e4dd;
  --border-strong: #d5d2c8;
  --accent: #0f766e;
  --accent-strong: #0b5d57;
  --accent-soft: rgba(15, 118, 110, 0.09);
  --code-bg: #16181c;
  --code-head: #1f2227;
  --code-text: #e7e7e6;
  --shadow-sm: 0 1px 2px rgba(27, 28, 30, 0.05);
  --shadow-md: 0 12px 34px -20px rgba(27, 28, 30, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", "Consolas",
    "Liberation Mono", monospace;
  --header-h: 64px;
}

html[data-theme="dark"] {
  --bg: #101113;
  --bg-soft: #16181a;
  --surface: #191b1e;
  --surface-2: #1e2024;
  --text: #e9e9e7;
  --text-soft: #a9aeb4;
  --text-mute: #7a8087;
  --border: #2a2d31;
  --border-strong: #3a3e43;
  --accent: #5ad3c7;
  --accent-strong: #7ee6da;
  --accent-soft: rgba(90, 211, 199, 0.12);
  --code-bg: #0c0e10;
  --code-head: #15181b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 18px 44px -26px rgba(0, 0, 0, 0.9);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #101113;
    --bg-soft: #16181a;
    --surface: #191b1e;
    --surface-2: #1e2024;
    --text: #e9e9e7;
    --text-soft: #a9aeb4;
    --text-mute: #7a8087;
    --border: #2a2d31;
    --border-strong: #3a3e43;
    --accent: #5ad3c7;
    --accent-strong: #7ee6da;
    --accent-soft: rgba(90, 211, 199, 0.12);
    --code-bg: #0c0e10;
    --code-head: #15181b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 44px -26px rgba(0, 0, 0, 0.9);
  }
}

/* ---------------- 基础 ---------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.18s ease, opacity 0.18s ease;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 640;
  letter-spacing: -0.015em;
  line-height: 1.32;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

.dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  vertical-align: middle;
  margin: 0 2px;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.12s linear;
}

/* ---------------- 顶栏 ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: transform 0.3s ease;
}

.brand:hover .brand-mark {
  transform: rotate(45deg) scale(1.05);
}

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

.site-nav a {
  position: relative;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--text-soft);
}

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

.site-nav a.is-active {
  color: var(--accent-strong);
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

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

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

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.when-dark {
  display: none;
}

html[data-theme="dark"] .when-light {
  display: none;
}

html[data-theme="dark"] .when-dark {
  display: inline-flex;
}

.menu-btn {
  display: none;
}

/* ---------------- 首页 Hero ---------------- */

.hero {
  position: relative;
  padding: 60px 0 34px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% 30% auto -10%;
  height: 380px;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 72%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
}

.hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  flex: none;
}

.hero-greeting {
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}

.hero-name {
  margin: 6px 0 10px;
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 700;
}

.hero-line {
  color: var(--text-soft);
  font-size: 15.5px;
  max-width: 46ch;
}

.hero-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 内容布局 ---------------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 36px;
  align-items: start;
  padding-top: 8px;
  padding-bottom: 80px;
}

.main-col {
  min-width: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--text-mute);
}

.section-more:hover {
  color: var(--accent-strong);
}

.section-more svg {
  width: 15px;
  height: 15px;
}

/* ---------------- 文章卡片 ---------------- */

.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  box-shadow: var(--shadow-md);
}

.post-card .card-cover {
  display: block;
  aspect-ratio: 2.6 / 1;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

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

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

.card-body {
  padding: 22px 26px 20px;
}

.card-title {
  font-size: 20px;
  line-height: 1.45;
}

.card-title a {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.28s ease, color 0.2s;
}

.post-card:hover .card-title a {
  color: var(--accent-strong);
  background-size: 100% 1.5px;
}

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

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.card-tags {
  display: inline-flex;
  gap: 6px;
}

/* ---------------- 标签 ---------------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12.5px;
  line-height: 1.7;
  transition: background 0.18s, color 0.18s;
}

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

.tag em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.7;
}

.tag-sm {
  padding: 2px 9px;
  font-size: 12px;
}

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

.tag-cloud-lg {
  gap: 10px;
  padding: 4px 0 24px;
}

.tag-cloud-lg .tag {
  font-size: 14px;
  padding: 6px 14px;
}

/* ---------------- 侧栏 ---------------- */

.side-col {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.widget-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 14px;
}

.profile-widget {
  text-align: center;
  padding-top: 26px;
}

.widget-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  margin: 0 auto 14px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

.widget-name {
  font-size: 17px;
}

.widget-bio {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.7;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-soft);
  background: var(--bg-soft);
}

.social-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.social-link svg {
  width: 14px;
  height: 14px;
}

.recent-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-list a {
  display: block;
}

.recent-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
}

.recent-list a:hover .recent-title {
  color: var(--accent-strong);
}

.recent-list time {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 分页 ---------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  font-size: 13.5px;
}

.page-nums {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.page-num:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.page-num.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-gap {
  color: var(--text-mute);
  padding: 0 2px;
}

.page-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--text-soft);
  border: 1px solid transparent;
}

.page-arrow svg {
  width: 15px;
  height: 15px;
}

.page-arrow:hover {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.page-arrow.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------------- 文章页 ---------------- */

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 48px;
  align-items: start;
  max-width: 1030px;
  padding-top: 52px;
  padding-bottom: 72px;
}

.post {
  min-width: 0;
  max-width: 720px;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.post-title {
  font-size: clamp(27px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.post-excerpt {
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-soft);
  line-height: 1.75;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

/* 正文排版 */
.post-body {
  padding-top: 26px;
  font-size: 16.5px;
  line-height: 1.88;
  color: var(--text);
  overflow-wrap: break-word;
}

.post-body > * + * {
  margin-top: 1.15em;
}

.post-body h2 {
  position: relative;
  margin-top: 2em;
  margin-bottom: 0.7em;
  font-size: 24px;
  padding-bottom: 0.35em;
}

.post-body h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
}

.post-body h3 {
  margin-top: 1.9em;
  margin-bottom: 0.6em;
  font-size: 19.5px;
}

.post-body h4 {
  margin-top: 1.6em;
  font-size: 17px;
}

.post-body .anchor {
  position: absolute;
  left: -0.85em;
  color: var(--accent);
  opacity: 0;
  font-weight: 400;
  transition: opacity 0.2s;
}

.post-body h2:hover .anchor,
.post-body h3:hover .anchor,
.post-body h4:hover .anchor {
  opacity: 0.6;
}

.post-body p {
  margin: 0;
}

.post-body a {
  color: var(--accent-strong);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.post-body a:hover {
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

.post-body strong {
  font-weight: 660;
}

.post-body ul,
.post-body ol {
  padding-left: 1.35em;
}

.post-body li + li {
  margin-top: 0.35em;
}

.post-body li::marker {
  color: var(--text-mute);
}

.post-body blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text-soft);
}

.post-body blockquote p + p {
  margin-top: 0.8em;
}

.post-body hr {
  margin: 2.6em 0;
  border: 0;
  border-top: 1px dashed var(--border-strong);
}

.post-body img {
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 1.6em auto;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.42em;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.post-body mark {
  background: color-mix(in srgb, #f5c518 45%, transparent);
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

/* 代码块 */
.code-block {
  margin: 1.7em 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border);
}

.code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--code-head);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa1a9;
}

.code-block .copy-btn {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  color: #b9c0c7;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.18s;
}

.code-block .copy-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.code-block .copy-btn.is-done {
  color: #6fe3b8;
  border-color: rgba(111, 227, 184, 0.4);
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 13.2px;
  line-height: 1.72;
  tab-size: 2;
}

.post-body .code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* 表格 */
.table-wrap {
  overflow-x: auto;
  margin: 1.7em 0;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.post-body th,
.post-body td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.post-body th {
  background: var(--surface-2);
  font-weight: 600;
  white-space: nowrap;
}

.post-body tr:last-child td {
  border-bottom: 0;
}

/* 目录 */
.toc {
  position: sticky;
  top: calc(var(--header-h) + 30px);
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow: auto;
  font-size: 13px;
  padding-left: 2px;
}

.toc-title {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 10px;
}

.toc ul {
  list-style: none;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc li a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-mute);
  line-height: 1.55;
  transition: color 0.18s, border-color 0.18s;
}

.toc li.toc-l3 a {
  padding-left: 24px;
  font-size: 12.5px;
}

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

.toc li a.is-active {
  color: var(--accent-strong);
  border-left-color: var(--accent);
}

/* 文末 */
.post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

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

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}

.post-nav-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}

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

.post-nav-item span {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--text-mute);
  text-transform: uppercase;
}

.post-nav-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.55;
}

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

.related {
  padding-bottom: 80px;
}

.related h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-soft);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.related-grid .post-card {
  margin-bottom: 0;
}

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

.comments-title {
  font-size: 17px;
  margin-bottom: 18px;
}

/* ---------------- 归档 / 标签 / 页面 ---------------- */

.page-narrow {
  max-width: 780px;
  padding-top: 56px;
  padding-bottom: 90px;
}

.page-header {
  margin-bottom: 34px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(28px, 3.4vw, 36px);
  font-weight: 700;
}

.page-header p {
  margin-top: 8px;
  color: var(--text-mute);
  font-size: 14px;
}

.page-kicker {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent) !important;
  margin-bottom: 6px;
}

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

.archive-year-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.archive-year-title span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mute);
}

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

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

.archive-list li:last-child {
  border-bottom: 0;
}

.archive-list time {
  flex: none;
  width: 52px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.archive-list a {
  font-size: 15.5px;
  line-height: 1.6;
}

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

.back-link {
  margin-top: 34px;
  font-size: 14px;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-mute);
}

.back-link a:hover {
  color: var(--accent-strong);
}

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

.post-list .post-card:last-child {
  margin-bottom: 0;
}

.empty {
  padding: 40px 0;
  color: var(--text-mute);
}

/* ---------------- 404 ---------------- */

.notfound {
  max-width: 560px;
  padding-top: 120px;
  padding-bottom: 140px;
  text-align: center;
}

.notfound-code {
  font-family: var(--font-mono);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: -0.04em;
}

.notfound h1 {
  margin-top: 18px;
  font-size: 26px;
}

.notfound p {
  margin-top: 10px;
  color: var(--text-soft);
}

.notfound-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  border: 1px solid var(--accent);
  transition: transform 0.18s, opacity 0.18s;
}

.btn:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

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

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-mute);
}

/* ---------------- 页脚 ---------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 0;
}

.footer-inner {
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
}

.footer-line {
  line-height: 1.9;
}

.footer-sub {
  font-size: 12.5px;
  opacity: 0.85;
}

.footer-icp {
  margin-left: 8px;
}

.footer-icp:hover {
  color: var(--accent-strong);
}

/* ---------------- 回到顶部 ---------------- */

.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 70;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-soft);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s, color 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

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

.to-top svg {
  width: 18px;
  height: 18px;
}

/* ---------------- 搜索 ---------------- */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: center;
  padding: 10vh 20px 20px;
}

.search-modal[hidden] {
  display: none;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--text) 42%, transparent);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}

.search-panel {
  position: relative;
  width: min(660px, 100%);
  align-self: flex-start;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
}

.search-field svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.search-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 15.5px;
  color: var(--text);
}

.search-close {
  display: inline-flex;
  padding: 4px;
  border-radius: 6px;
  color: var(--text-mute);
}

.search-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.search-close svg {
  width: 16px;
  height: 16px;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow-y: auto;
}

.search-results:empty {
  display: none;
}

.search-results li a {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
}

.search-results li a:hover,
.search-results li a.is-focused {
  background: var(--bg-soft);
}

.search-results .r-title {
  font-size: 15px;
  font-weight: 560;
}

.search-results .r-title mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 700;
}

.search-results .r-meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-mute);
}

.search-hint {
  padding: 10px 18px 16px;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px solid var(--border);
}

/* ---------------- 动画 ---------------- */

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------------- 响应式 ---------------- */

/* ---------------- 首页栅格 ---------------- */

.home-main {
  padding-top: 20px;
  padding-bottom: 10px;
}

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

.post-grid .post-card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.post-grid .card-cover {
  aspect-ratio: 2.4 / 1;
}

.post-grid .card-excerpt {
  -webkit-line-clamp: 3;
}

.card-cover.card-cover-ph {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 36% 93%), hsl(calc(var(--h) + 45) 42% 86%));
}

.card-cover-ph::after {
  content: "";
  position: absolute;
  inset: auto -10% -60% auto;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, hsl(var(--h) 60% 70% / 0.35), transparent);
}

.card-cover-ph span {
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--h) 45% 32%);
  opacity: 0.22;
  letter-spacing: -0.02em;
  transform: translateY(-2px);
}

html[data-theme="dark"] .card-cover-ph {
  background: linear-gradient(135deg, hsl(var(--h) 20% 15%), hsl(calc(var(--h) + 45) 24% 20%));
}

html[data-theme="dark"] .card-cover-ph span {
  color: hsl(var(--h) 50% 78%);
  opacity: 0.24;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .card-cover-ph {
    background: linear-gradient(135deg, hsl(var(--h) 20% 15%), hsl(calc(var(--h) + 45) 24% 20%));
  }
  html:not([data-theme="light"]) .card-cover-ph span {
    color: hsl(var(--h) 50% 78%);
    opacity: 0.24;
  }
}

.home-extra {
  padding-top: 34px;
  padding-bottom: 84px;
}

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

.extra-head h2 {
  font-size: 17px;
  letter-spacing: 0.02em;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.hero-stats strong {
  color: var(--text);
  font-weight: 600;
}

.hero-stats .sep {
  width: 1px;
  height: 12px;
  background: var(--border-strong);
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-col {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin-top: 8px;
  }
  .post-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 760px;
  }
  .toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .menu-btn {
    display: inline-flex;
  }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  .site-nav.is-open {
    display: flex;
    animation: pop 0.18s ease;
  }
  .site-nav a {
    padding: 11px 12px;
    font-size: 15px;
  }
  .site-nav a.is-active::after {
    display: none;
  }
  .site-nav a.is-active {
    background: var(--accent-soft);
  }
  .header-actions {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }
  .hero {
    padding: 40px 0 26px;
  }
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
  .hero-avatar {
    width: 68px;
    height: 68px;
    border-radius: 20px;
  }
  .hero-tags {
    flex-wrap: wrap;
    gap: 6px;
  }
  .card-body {
    padding: 18px 20px 16px;
  }
  .card-title {
    font-size: 18px;
  }
  .post-layout {
    padding-top: 34px;
  }
  .post-header {
    padding-top: 0;
  }
  .post-body {
    font-size: 16px;
  }
  .post-nav {
    grid-template-columns: 1fr;
  }
  .post-nav-item.next {
    text-align: left;
  }
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  .widget {
    padding: 18px;
  }
  .notfound {
    padding-top: 80px;
    padding-bottom: 100px;
  }
  .notfound-code {
    font-size: 56px;
  }
  .footer-inner {
    font-size: 12.5px;
  }
}
