/* =========================================================
   纸上博客 — 视觉样式
   设计方向：中文活字排印 / 纸张质感 / 朱砂红点缀
   ========================================================= */

:root {
  --paper: #f4efe5;
  --paper-2: #ece5d7;
  --paper-3: #e3dbca;
  --ink: #17130f;
  --ink-soft: #5d5349;
  --ink-faint: #8c8173;
  --line: rgba(23, 19, 15, 0.16);
  --line-strong: rgba(23, 19, 15, 0.42);
  --accent: #b23a24;
  --accent-soft: rgba(178, 58, 36, 0.1);
  --shadow: 0 18px 50px -28px rgba(23, 19, 15, 0.55);

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC",
    "Noto Serif CJK SC", "Source Han Serif SC", STSong, Georgia, serif;
  --font-body: Optima, "Avenir Next", "Helvetica Neue", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --wrap: 1180px;
  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --paper: #141110;
  --paper-2: #1c1815;
  --paper-3: #24201c;
  --ink: #eee5d7;
  --ink-soft: #a79a8a;
  --ink-faint: #7c7166;
  --line: rgba(238, 229, 215, 0.14);
  --line-strong: rgba(238, 229, 215, 0.42);
  --accent: #e2683f;
  --accent-soft: rgba(226, 104, 63, 0.14);
  --shadow: 0 18px 50px -28px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
  overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

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

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

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

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

.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E");
}
[data-theme="dark"] .grain { opacity: 0.22; mix-blend-mode: screen; }

/* --------------------------------------------------------- 头部 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px) saturate(1.2);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }

.brand-mark {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.brand-sub {
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-nav { display: flex; gap: 34px; }

.desktop-nav a {
  position: relative;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}

.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.desktop-nav a:hover, .desktop-nav a.active { color: var(--ink); }
.desktop-nav a:hover::after, .desktop-nav a.active::after { transform: scaleX(1); }

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

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink-soft);
  transition: 0.25s var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line); background: var(--paper-2); }
.icon-btn svg { width: 18px; height: 18px; }

#themeBtn .moon { display: none; }
[data-theme="dark"] #themeBtn .sun { display: none; }
[data-theme="dark"] #themeBtn .moon { display: block; }

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.menu-btn span {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  transition: 0.3s var(--ease);
}
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 23px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 20px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 20px; transform: rotate(-45deg); }

/* --------------------------------------------------------- 移动菜单 / 搜索 */

.mobile-menu {
  position: fixed;
  inset: 74px 0 0;
  z-index: 35;
  background: var(--paper);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0.3s;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: none; }

.mobile-menu nav { display: flex; flex-direction: column; }

.mobile-menu nav a {
  font-family: var(--font-display);
  font-size: clamp(30px, 9vw, 44px);
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 16px;
  line-height: 1.2;
}
.mobile-menu nav a i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.mobile-menu nav a.active { color: var(--accent); }

.mobile-menu-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.mobile-menu-foot a { color: var(--ink-soft); }

.search-panel {
  position: fixed;
  inset: 74px 0 auto;
  z-index: 38;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 28px 32px;
  transform: translateY(-110%);
  transition: transform 0.4s var(--ease);
  box-shadow: var(--shadow);
}
.search-panel.open { transform: none; }

.search-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  display: flex;
  gap: 18px;
  align-items: center;
}

#searchForm { flex: 1; display: flex; gap: 0; border-bottom: 1px solid var(--line-strong); }
#searchForm input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  padding: 10px 2px;
  font-family: var(--font-display);
  font-size: 20px;
}
#searchForm input::placeholder { color: var(--ink-faint); }
#searchForm button, .search-close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 13px;
  padding: 10px 0 10px 18px;
}
.search-close { color: var(--ink-faint); }

/* --------------------------------------------------------- 布局通用 */

.app { min-height: 60vh; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 34px;
}

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0;
  letter-spacing: 0.04em;
}

.section-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
}

.section-head .more {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: 0.25s;
}
.section-head .more:hover { color: var(--accent); border-color: var(--accent); }

/* 入场动画 */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal 0.9s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes reveal { to { opacity: 1; transform: none; } }

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

.hero {
  border-bottom: 1px solid var(--line-strong);
  padding: 78px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 56px;
  align-items: end;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.hero-eyebrow::before { content: ""; width: 46px; height: 1px; background: var(--accent); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 8.4vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0 0 26px;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-bio {
  max-width: 34em;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.9;
  margin: 0;
}

.hero-meta {
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.hero-meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.hero-meta dd { margin: 0; }
.hero-meta a:hover { color: var(--accent); }

.hero-stat {
  display: flex;
  gap: 26px;
  margin-top: 8px;
}
.hero-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.1;
}
.hero-stat span { font-size: 10.5px; letter-spacing: 0.14em; color: var(--ink-faint); }

/* 特色文章 */
.featured { padding: 60px 0 24px; }

.featured-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 210px;
  gap: 30px;
  align-items: start;
  padding-bottom: 42px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.featured-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding-top: 10px;
}

.featured-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(27px, 4.2vw, 44px);
  line-height: 1.28;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  transition: color 0.25s;
}
.featured-card:hover .featured-title { color: var(--accent); }

.featured-summary {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 18px;
  max-width: 46em;
}

.featured-side {
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.featured-side .date { font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--ink-soft); }

/* 文章列表 */
.post-list { padding: 44px 0 10px; }

.post-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 26px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
  transition: padding-left 0.4s var(--ease);
}
.post-row:hover { padding-left: 10px; }
.post-row:hover .post-row-title { color: var(--accent); }

.post-row-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  padding-top: 8px;
}

.post-row-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.6vw, 27px);
  line-height: 1.42;
  margin: 0 0 8px;
  transition: color 0.25s;
}

.post-row-summary {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 12px;
  max-width: 52em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.post-meta .dot::before { content: "·"; margin-right: 16px; }
.post-tag {
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
  transition: 0.2s;
}
.post-tag:hover { border-color: var(--accent); color: var(--accent); }

.post-row-arrow {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink-faint);
  transition: 0.3s var(--ease);
  padding-top: 4px;
}
.post-row:hover .post-row-arrow { color: var(--accent); transform: translateX(5px); }

/* 首页两栏 */
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 72px;
  align-items: start;
  padding-bottom: 40px;
}

.side-block { padding: 34px 0; border-top: 1px solid var(--line-strong); }
.side-block:first-child { border-top: none; padding-top: 0; }
.side-block h3 {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 18px;
  font-weight: 500;
}
.side-bio { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.side-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  object-fit: cover; margin-bottom: 14px;
  border: 1px solid var(--line);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: 12.5px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}
.tag-cloud a:hover { color: var(--accent); border-color: var(--accent); }
.tag-cloud a sup { font-family: var(--font-mono); font-size: 9px; color: var(--ink-faint); margin-left: 3px; }

.side-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-soft);
  border-left: 2px solid var(--accent);
  padding-left: 16px;
}

/* --------------------------------------------------------- 页面头 */

.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line-strong); }
.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--accent);
  text-transform: uppercase;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.1;
  margin: 14px 0 12px;
  letter-spacing: -0.015em;
}
.page-head p { color: var(--ink-soft); margin: 0; max-width: 40em; }

/* 加载更多 / 分页 */
.load-more {
  display: block;
  margin: 44px auto 0;
  background: none;
  border: 1px solid var(--line-strong);
  padding: 14px 42px;
  letter-spacing: 0.18em;
  font-size: 12px;
  cursor: pointer;
  transition: 0.3s var(--ease);
  color: var(--ink-soft);
}
.load-more:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.load-more:disabled { opacity: 0.4; cursor: default; }

/* --------------------------------------------------------- 文章详情 */

.article { padding: 60px 0 20px; }

.article-header {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.article-header .kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--accent);
  text-transform: uppercase;
}

.article-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5.4vw, 50px);
  line-height: 1.3;
  margin: 18px 0 20px;
  letter-spacing: -0.01em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.article-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 46px 0 30px;
  font-size: 16.5px;
  line-height: 2;
  color: var(--ink);
}

.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.35em; }

.article-body > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.86;
  padding: 6px 12px 0 0;
  color: var(--accent);
}

.article-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(23px, 3.2vw, 30px);
  line-height: 1.4;
  margin: 2em 0 0.7em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  letter-spacing: 0.01em;
}
.article-body h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  margin: 1.8em 0 0.6em;
}

.article-body blockquote {
  margin: 2em 0;
  padding: 6px 0 6px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
}
.article-body blockquote p { margin: 0.4em 0; }

.article-body ul, .article-body ol { padding-left: 1.4em; margin: 0 0 1.35em; }
.article-body li { margin-bottom: 0.45em; }
.article-body li::marker { color: var(--accent); }

.article-body a { color: var(--accent); border-bottom: 1px solid var(--accent-soft); }
.article-body a:hover { border-color: var(--accent); }

.article-body img { margin: 2em 0; border: 1px solid var(--line); }

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
}

.article-body pre {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.8;
  margin: 1.8em 0;
}
.article-body pre code { background: none; border: none; padding: 0; font-size: 13px; }

.article-body hr { border: none; border-top: 1px solid var(--line); margin: 3em 0; }

.article-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 1.8em 0; }
.article-body th, .article-body td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { font-size: 12px; letter-spacing: 0.1em; color: var(--ink-faint); font-weight: 500; }

.article-tags {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 40px;
}

.article-nav {
  max-width: 700px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.article-nav a {
  background: var(--paper);
  padding: 24px 26px;
  transition: background 0.3s;
}
.article-nav a:hover { background: var(--paper-2); }
.article-nav span {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.article-nav strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
}
.article-nav .next { text-align: right; }

.article-back {
  max-width: 700px;
  margin: 40px auto 0;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.article-back:hover { color: var(--accent); }

/* --------------------------------------------------------- 归档 / 标签 */

.archive { padding: 30px 0 60px; }
.archive-group {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 30px;
  padding: 34px 0 10px;
  border-bottom: 1px solid var(--line);
}
.archive-year {
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  color: var(--ink-faint);
  letter-spacing: -0.02em;
}
.archive-year small { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; margin-top: 8px; color: var(--ink-faint); }
.archive-items { display: flex; flex-direction: column; }
.archive-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--line);
  align-items: baseline;
}
.archive-item:last-child { border-bottom: none; }
.archive-item time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }
.archive-item a { font-family: var(--font-display); font-size: 18px; transition: color 0.2s; }
.archive-item a:hover { color: var(--accent); }

.tag-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 60px;
}
.tag-wall a {
  background: var(--paper);
  padding: 28px 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  transition: background 0.25s;
}
.tag-wall a:hover { background: var(--paper-2); }
.tag-wall .name { font-family: var(--font-display); font-size: 22px; }
.tag-wall .count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 26px 0;
}
.filter-bar span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.18em; color: var(--ink-faint); margin-right: 6px; }
.chip {
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  color: var(--ink-soft);
  cursor: pointer;
  background: none;
  transition: 0.2s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --------------------------------------------------------- 关于 */

.about { padding: 60px 0 70px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 70px; }
.about-side { position: sticky; top: 110px; align-self: start; }
.about-avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper-2);
  margin-bottom: 18px;
}
.about-name { font-family: var(--font-display); font-size: 26px; margin: 0 0 6px; font-weight: 400; }
.about-role { font-size: 12px; letter-spacing: 0.16em; color: var(--ink-faint); margin: 0 0 20px; }
.about-links { display: flex; flex-direction: column; gap: 10px; font-size: 13px; border-top: 1px solid var(--line); padding-top: 18px; }
.about-links a, .about-links span { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); }
.about-links a:hover { color: var(--accent); }
.about-links em { font-style: normal; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--ink-faint); }

.about-body { max-width: 680px; font-size: 16px; line-height: 2; }
.about-body > p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2em;
  float: left;
  line-height: 0.86;
  padding: 6px 12px 0 0;
  color: var(--accent);
}
.about-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  margin: 2em 0 0.6em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
}
.about-body blockquote {
  margin: 2em 0;
  padding-left: 22px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
}
.about-body ul { padding-left: 1.3em; }
.about-body li::marker { color: var(--accent); }
.about-body a { color: var(--accent); }

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

.site-footer { border-top: 1px solid var(--line-strong); margin-top: 20px; }
.footer-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 54px 32px 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.footer-note { margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.footer-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.footer-meta a:hover { color: var(--accent); }

/* --------------------------------------------------------- 状态 / 其他 */

.empty {
  padding: 70px 0 90px;
  text-align: center;
  color: var(--ink-faint);
}
.empty .mark { font-family: var(--font-display); font-size: 42px; color: var(--accent); display: block; margin-bottom: 12px; }

.skeleton { padding: 60px 0; }
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2));
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  margin-bottom: 14px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.big { height: 46px; width: 78%; margin-bottom: 26px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.05em;
  opacity: 0;
  pointer-events: none;
  transition: 0.35s var(--ease);
  z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 代码高亮（对应 Pygments codehilite） */
.codehilite { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); margin: 1.8em 0; }
.codehilite pre { border: none; margin: 0; background: none; }
.codehilite .c, .codehilite .c1, .codehilite .cm, .codehilite .cs { color: var(--ink-faint); font-style: italic; }
.codehilite .k, .codehilite .kn, .codehilite .kd, .codehilite .kr { color: var(--accent); }
.codehilite .s, .codehilite .s1, .codehilite .s2, .codehilite .sd, .codehilite .se { color: #6b7f3f; }
.codehilite .nf, .codehilite .fm { color: #2f6f8f; }
.codehilite .nb, .codehilite .bp { color: #8a5a2b; }
.codehilite .mi, .codehilite .mf, .codehilite .m { color: #8a5a2b; }
.codehilite .o, .codehilite .ow { color: var(--ink-soft); }
.codehilite .nt { color: var(--accent); }
.codehilite .na { color: #2f6f8f; }
[data-theme="dark"] .codehilite .s, [data-theme="dark"] .codehilite .s1, [data-theme="dark"] .codehilite .s2 { color: #a3b86c; }
[data-theme="dark"] .codehilite .nf, [data-theme="dark"] .codehilite .fm, [data-theme="dark"] .codehilite .na { color: #7fb2c9; }

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

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) 220px; gap: 38px; }
  .home-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .home-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
  .featured-card { grid-template-columns: 74px minmax(0, 1fr); }
  .featured-side { grid-column: 2; border-left: none; border-top: 1px solid var(--line); padding: 14px 0 0; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
  .about { grid-template-columns: 210px minmax(0, 1fr); gap: 44px; }
}

@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .menu-btn { display: block; }
  .header-inner { padding: 0 20px; height: 66px; }
  .brand-sub { display: none; }
  .mobile-menu { inset: 66px 0 0; }
  .search-panel { inset: 66px 0 auto; padding: 20px; }
  .search-inner { flex-wrap: wrap; gap: 10px; }
  #searchForm input { font-size: 17px; }

  .wrap { padding: 0 20px; }
  .hero { padding: 46px 0 34px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .hero-title { font-size: clamp(38px, 11vw, 62px); }
  .hero-meta { flex-direction: row; flex-wrap: wrap; gap: 18px 30px; }
  .hero-meta > div { min-width: 92px; }

  .section-head { margin-bottom: 22px; }
  .featured { padding: 36px 0 10px; }
  .featured-card { grid-template-columns: 1fr; gap: 0; padding-bottom: 30px; }
  .featured-index { padding: 0 0 10px; }
  .featured-side { grid-column: auto; }

  .post-list { padding-top: 26px; }
  .post-row { grid-template-columns: 1fr; gap: 8px; padding: 24px 0; }
  .post-row-num { padding: 0; }
  .post-row-arrow { display: none; }
  .post-row:hover { padding-left: 0; }

  .page-head { padding: 40px 0 26px; }
  .article { padding: 34px 0 0; }
  .article-header { text-align: left; padding-bottom: 26px; }
  .article-meta { justify-content: flex-start; gap: 6px 14px; }
  .article-body { padding: 30px 0 20px; font-size: 16px; line-height: 1.95; }
  .article-body > p:first-of-type::first-letter { font-size: 3em; }
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .next { text-align: left; }

  .archive-group { grid-template-columns: 1fr; gap: 12px; padding-top: 28px; }
  .archive-year { font-size: 34px; display: flex; align-items: baseline; gap: 12px; }
  .archive-year small { margin-top: 0; }
  .archive-item { grid-template-columns: 74px minmax(0, 1fr); }

  .tag-wall { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tag-wall a { padding: 20px 18px; }
  .tag-wall .name { font-size: 18px; }

  .about { grid-template-columns: 1fr; gap: 34px; padding: 34px 0 50px; }
  .about-side { position: static; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; align-items: start; }
  .about-avatar { width: 110px; height: 110px; aspect-ratio: 1; border-radius: 50%; margin: 0; }
  .about-side-body { min-width: 0; }
  .about-name { font-size: 22px; }
  .about-links { border-top: none; padding-top: 0; font-size: 12.5px; }

  .footer-inner { grid-template-columns: 1fr; padding: 36px 20px 30px; align-items: start; gap: 12px; }
  .footer-note { order: 3; }
}

@media (max-width: 480px) {
  .post-meta { gap: 6px 12px; font-size: 10.5px; }
  .post-meta .dot::before { margin-right: 12px; }
  .hero-stat { gap: 20px; }
  .load-more { width: 100%; padding: 14px 0; }
  .home-aside { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
/* --------------------------------------------------------- 文章目录与代码复制 */

.article-toc {
  max-width: 700px;
  margin: 0 auto;
  padding: 26px 32px 0;
  font-family: var(--font-mono);
}

.article-toc .toc-title {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

.article-toc ol {
  list-style: none;
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--line);
}

.article-toc li { margin: 0 0 9px; font-size: 12.5px; line-height: 1.7; }
.article-toc li.lvl-h3 { padding-left: 16px; font-size: 12px; opacity: 0.72; }
.article-toc a { color: var(--ink-soft); text-decoration: none; border: none; }
.article-toc a:hover { color: var(--accent); }

.article-body pre { position: relative; }

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.article-body pre:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

@media (hover: none) {
  .copy-btn { opacity: 0.75; }
}

@media (max-width: 640px) {
  .article-toc { padding-left: 22px; padding-right: 22px; }
}

/* Hand-inked coast scene: scoped palette and controls. Motion is driven by pelican.js. */
.pelican-figure.pc-coast {
  --pc-paper: #f4eddd;
  --pc-sand: #dfd0ae;
  --pc-sea: #c4d0c3;
  --pc-far: #a5b5a4;
  --pc-foam: #6d8980;
  --pc-cloud: #fff9ec;
  --pc-sun: #d69b62;
  --pc-bird: #fbf3e3;
  --pc-feather: #d8cab0;
  --pc-gold: #c68b43;
  --pc-pouch: #ad6f4c;
  --pc-red: #a84e3b;
  --pc-grass: #77775c;
  --pc-metal: #625c4f;
  --pc-ink: #38372f;
  margin: 0;
}
:root[data-theme="dark"] .pelican-figure.pc-coast {
  --pc-paper: #393c36;
  --pc-sand: #595746;
  --pc-sea: #536b64;
  --pc-far: #718277;
  --pc-foam: #a2b4a4;
  --pc-cloud: #62665d;
  --pc-sun: #d0a169;
  --pc-bird: #d9d0bd;
  --pc-feather: #aaa18d;
  --pc-gold: #d0a05d;
  --pc-pouch: #b97b56;
  --pc-red: #c17a62;
  --pc-grass: #9a9a73;
  --pc-metal: #c0b69d;
  --pc-ink: #e2dac7;
}
.pelican-figure.pc-coast svg { display: block; width: 100%; height: auto; overflow: hidden; }
.pelican-figure.pc-coast figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
}

/* 首页：海岸骑行插画 */
.pelican-band { padding: 6px 0 60px; }
.pelican-band .home-pelican { max-width: 880px; margin: 0 auto; }
@media (max-width: 760px) {
  .pelican-band { padding: 0 0 40px; }
}
