/* ==========================================================================
   林深暮雪 · 增强样式（在 style.css 之后加载）
   ========================================================================== */

/* ---------- 阅读进度条 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 120;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ---------- 首屏数据 ---------- */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  margin-top: 46px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 620px;
}

.stat .num {
  display: block;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.stat .num small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
  letter-spacing: 0.08em;
}

.stat .label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

/* ---------- 标签 ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-soft);
  background: var(--card);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.22s ease;
}

.chip:hover,
.chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  opacity: 1;
}

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

.chip.active .n,
.chip:hover .n { color: var(--accent); }

/* 文章卡片上的小标签 */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.post-tags span {
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 8px;
}

.post-item.hide { display: none; }

/* ---------- 站内搜索 ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  background: rgba(20, 18, 15, 0.42);
  backdrop-filter: blur(6px);
  padding: 0 16px;
}

.search-overlay.open { display: block; animation: fade 0.2s ease; }

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

.search-panel {
  width: min(640px, 100%);
  margin: 11vh auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-family: var(--sans);
  letter-spacing: 0.02em;
}

.search-bar input::placeholder { color: var(--muted); }

.search-hint {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--mono);
  flex: none;
}

.search-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 8px;
}

.search-results a {
  display: block;
  padding: 13px 16px;
  border-radius: 9px;
  color: var(--text);
}

.search-results a:hover,
.search-results a.sel {
  background: var(--bg-soft);
  opacity: 1;
}

.search-results .r-title {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
}

.search-results .r-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.search-results .r-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------- 文章页：目录 + 正文 ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 208px;
  gap: 64px;
  align-items: start;
}

.article-layout .article-body {
  max-width: none;
  margin: 0;
}

.toc {
  position: sticky;
  top: 96px;
  padding-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.toc .toc-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

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

.toc li { margin-bottom: 2px; }

.toc a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  border-left: 2px solid transparent;
  margin-left: -20px;
  padding-left: 18px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

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

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

.toc .lv3 a { padding-left: 32px; font-size: 12.5px; }

/* ---------- 上一篇 / 下一篇 ---------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 760px;
  margin: 0 auto 8px;
}

.post-nav a {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

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

.post-nav .dir {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 8px;
}

.post-nav .ttl {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
}

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

/* ---------- 订阅区块 ---------- */
.subscribe {
  margin: 0 0 64px;
  padding: 46px 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.subscribe h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.03em;
}

.subscribe p {
  color: var(--text-soft);
  font-size: 14.5px;
  margin: 0 0 24px;
}

.rss-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.rss-btn:hover { opacity: 0.88; }

.rss-btn svg { width: 15px; height: 15px; }

/* ---------- 归档页 ---------- */
.archive-wrap { padding: 80px 0 40px; }

.archive-wrap > h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 46px);
  font-weight: 600;
  margin: 0 0 12px;
}

.archive-wrap > .sub {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.06em;
  margin: 0 0 48px;
}

.archive-year {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 44px 0 10px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.archive-year em {
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 400;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.archive-list li {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 17px 4px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, padding-left 0.25s ease;
}

.archive-list li:hover {
  background: var(--bg-soft);
  padding-left: 12px;
}

.archive-list .d {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.archive-list .t {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--text);
}

.archive-list .c {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 80;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

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

.to-top:hover { color: var(--accent); }
.to-top svg { width: 17px; height: 17px; }

/* ---------- 关于页补充 ---------- */
.about-sections { margin-top: 8px; }

.about-sections h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 2.4em 0 0.7em;
  letter-spacing: 0.03em;
}

.about-sections h2:first-child { margin-top: 0; }

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
}

.skill-list li {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  background: var(--card);
}

/* ---------- 响应式补充 ---------- */
@media (max-width: 880px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .toc { display: none; }
}

@media (max-width: 860px) {
  .hero-stats { gap: 30px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .archive-list li { grid-template-columns: 64px 1fr; gap: 12px; }
  .archive-list .c { display: none; }
  .search-panel { margin-top: 7vh; }
  .to-top { right: 16px; bottom: 16px; }
}
