/* ==========================================================================
   代码与远方 · 主题样式
   设计参照 tech.meituan.com：1180 栅格 / 836+280 分栏 / 黄色点缀 / 大留白
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-sink: #f6f6f7;
  --card: #ffffff;
  --text: #111925;
  --text-2: rgba(17, 25, 37, 0.85);
  --text-3: rgba(17, 25, 37, 0.65);
  --text-4: rgba(17, 25, 37, 0.45);
  --line: rgba(17, 25, 37, 0.07);
  --line-strong: rgba(17, 25, 37, 0.12);
  --accent: #ffd000;
  --accent-soft: rgba(255, 208, 0, 0.14);
  --accent-ink: #b98600;
  --tag-bg: #f1f1f2;
  --tag-text: rgba(17, 25, 37, 0.65);
  --shadow-sm: 0 1px 2px rgba(17, 25, 37, 0.05);
  --shadow-md: 0 12px 32px -16px rgba(17, 25, 37, 0.28);
  --shadow-lg: 0 24px 64px -24px rgba(17, 25, 37, 0.35);
  --code-bg: #14181f;
  --radius: 8px;
  --wrap: 1180px;
  --header-h: 58px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme='dark'] {
  --bg: #0e1116;
  --bg-soft: #14181e;
  --bg-sink: #101419;
  --card: #161b22;
  --text: #e9edf3;
  --text-2: rgba(233, 237, 243, 0.86);
  --text-3: rgba(233, 237, 243, 0.62);
  --text-4: rgba(233, 237, 243, 0.42);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --accent-soft: rgba(255, 208, 0, 0.12);
  --accent-ink: #ffd000;
  --tag-bg: rgba(255, 255, 255, 0.07);
  --tag-text: rgba(233, 237, 243, 0.62);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 32px -16px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, 0.9);
  --code-bg: #0b0e13;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--text);
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
::selection { background: var(--accent); color: #111925; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-radius: 3px; }

.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.mobile-only.icon-btn { display: none; }

/* ==========================================================================
   顶栏
   ========================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 60;
  transition: background-color 0.2s var(--ease);
}
.header-inner { display: flex; align-items: center; height: 100%; gap: 40px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #111925;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  flex: none;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: 34px; height: 100%; }
.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s var(--ease);
}
.main-nav a:hover { color: var(--text); }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 15px;
  width: 0; height: 2px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.22s var(--ease);
}
.main-nav a:hover::after { width: 100%; }
.main-nav a.is-active { color: var(--text); font-weight: 600; }
.main-nav a.is-active::after { width: 100%; }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--bg);
  color: var(--text-4);
  font-size: 14px;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-3); }
.search-trigger kbd { margin-left: auto; }
kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--text-4);
}
.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--text-3);
}
.icon-btn:hover { background: var(--bg-sink); color: var(--text); }

/* ==========================================================================
   首页布局
   ========================================================================== */
.home { display: flex; align-items: flex-start; gap: 64px; padding: 40px 0 80px; }
.home-main { flex: 1 1 auto; min-width: 0; }
.sidebar { flex: 0 0 280px; width: 280px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- 首屏：轮播 + 热榜 ---------- */
.hero { display: grid; grid-template-columns: 540px 296px; height: 360px; margin-bottom: 44px; }

.carousel { position: relative; height: 360px; overflow: hidden; border-radius: var(--radius); background: #0b0f16; }
.carousel-track { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.slide.is-current { opacity: 1; pointer-events: auto; }
.slide-img { width: 100%; height: 100%; object-fit: cover; }
.car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
.carousel:hover .car-arrow { opacity: 1; }
.car-arrow:hover { background: rgba(0, 0, 0, 0.6); }
.car-arrow--prev { left: 12px; }
.car-arrow--next { right: 12px; }
.car-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 6px; }
.dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.25s var(--ease), background-color 0.25s var(--ease);
}
.dot.is-active { width: 20px; background: #fff; }

/* 热榜 */
.hot-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  height: 360px;
}
.hot-item { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 14px; height: 72px; transition: background-color 0.18s var(--ease); }
.hot-item::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  background: var(--accent); border-radius: 2px;
  opacity: 0; transition: opacity 0.18s var(--ease);
}
.hot-item:hover, .hot-item.is-active { background: var(--bg-soft); }
.hot-item:hover::before, .hot-item.is-active::before { opacity: 1; }
.hot-no {
  flex: none;
  display: grid; place-items: center;
  width: 21px; height: 21px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--accent);
  color: #111925;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.hot-item:nth-child(n + 4) .hot-no { background: var(--tag-bg); color: var(--text-4); }
.hot-item a {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s var(--ease);
}
.hot-item:hover a { color: var(--accent-ink); }

/* ---------- 区块标题 ---------- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.section-tabs { display: flex; gap: 28px; }
.tab {
  position: relative;
  padding: 13px 0 14px;
  font-size: 17.5px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}
.tab::after {
  content: '';
  position: absolute; left: 0; bottom: -1px;
  width: 30px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.section-more { padding-bottom: 14px; font-size: 13.5px; color: var(--text-4); transition: color 0.15s var(--ease); }
.section-more:hover { color: var(--accent-ink); }

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.18s var(--ease);
}
.post-row:last-child { border-bottom: 0; }
.post-row:hover .post-title a { color: var(--accent-ink); }
.post-body { flex: 1 1 auto; min-width: 0; }
.post-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1px;
}
.post-title a { transition: color 0.15s var(--ease); }
.post-desc {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.62;
  color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 13.5px;
  color: var(--text-3);
}
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item svg { opacity: 0.62; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 4px; }
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 12px;
  line-height: 1.5;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tag:hover { background: var(--accent-soft); color: var(--accent-ink); }
.post-thumb {
  flex: none;
  width: 150px; height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-sink);
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.post-row:hover .post-thumb img { transform: scale(1.04); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 40px 0 8px; }
.page-link {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-2);
  transition: all 0.18s var(--ease);
}
.page-link:hover { border-color: var(--accent); color: var(--text); }
.page-link.is-disabled { color: var(--text-4); border-color: var(--line); pointer-events: none; }
.page-current { font-size: 13.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   侧栏
   ========================================================================== */
.brand-card {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
  margin-bottom: 2px;
}
.brand-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mark--lg { width: 50px; height: 50px; border-radius: 11px; font-size: 15px; }
.brand-card-qr { color: var(--text); opacity: 0.86; }
.brand-card-text { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.brand-card-text strong { font-size: 15px; font-weight: 700; letter-spacing: 0.3px; }
.brand-card-text small { font-size: 12px; color: var(--text-4); }

.promo {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  height: 158px;
  padding: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  background: #0d1220;
  isolation: isolate;
}
.promo--green { background: linear-gradient(135deg, #061a15 0%, #0c3b2f 55%, #10513f 100%); }
.promo--blue { background: linear-gradient(135deg, #071021 0%, #12234d 55%, #1a3a7a 100%); }
.promo--purple { background: linear-gradient(135deg, #120a1f 0%, #2a1245 55%, #3d1a63 100%); }
.promo::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.42) 100%);
}
.promo::after {
  content: '';
  position: absolute; z-index: -1;
  right: -54px; bottom: -74px;
  width: 190px; height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.05), 0 0 0 62px rgba(255, 255, 255, 0.028);
  transition: transform 0.6s var(--ease);
}
.promo:hover::after { transform: scale(1.06) translate(-4px, -4px); }
.promo-glow {
  position: absolute; z-index: -1;
  width: 180px; height: 180px; right: -50px; top: -70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 68%);
  transition: transform 0.5s var(--ease);
}
.promo:hover .promo-glow { transform: scale(1.25); }
.promo-title { font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.promo-sub { margin-top: 6px; font-size: 12.5px; color: rgba(255, 255, 255, 0.66); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
}
.card-title {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.card-title svg { opacity: 0.55; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.toc { display: flex; flex-direction: column; gap: 2px; }
.toc-item {
  position: relative;
  padding: 6px 0 6px 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-3);
  border-left: 2px solid var(--line);
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.toc-item:hover { color: var(--text); }
.toc-item.is-active { color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.toc-level-3 { padding-left: 26px; font-size: 13px; }

/* ==========================================================================
   通用页面（归档 / 标签 / 关于 / 404）
   ========================================================================== */
.layout { display: flex; align-items: flex-start; gap: 64px; padding: 40px 0 80px; }
.page-shell { flex: 1 1 auto; min-width: 0; }
.page-head { padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0 0 10px; font-size: 30px; font-weight: 700; letter-spacing: 0.3px; }
.page-head p { margin: 0; font-size: 15px; color: var(--text-3); }

.archive-group { margin-top: 40px; }
.archive-year {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.archive-year span { font-size: 13px; font-weight: 400; color: var(--text-4); }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: flex; align-items: baseline; gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.archive-list time { flex: none; width: 52px; font-size: 13.5px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.archive-list a { font-size: 16px; font-weight: 500; transition: color 0.15s var(--ease); }
.archive-list a:hover { color: var(--accent-ink); }
.archive-tags { margin-left: auto; font-size: 12.5px; color: var(--text-4); white-space: nowrap; }

.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 28px; }
.tag-tile {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.18s var(--ease);
}
.tag-tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.tag-tile-name { font-size: 15px; font-weight: 600; }
.tag-tile-count { font-size: 12.5px; color: var(--text-4); }

.notfound { padding: 56px 0 80px; text-align: center; }
.notfound-code { margin: 0; font-size: 88px; font-weight: 800; letter-spacing: -2px; color: var(--accent); line-height: 1; }
.notfound h1 { margin: 16px 0 8px; font-size: 26px; font-weight: 700; }
.notfound-text { margin: 0 0 28px; color: var(--text-3); }
.btn-primary {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 22px;
  background: var(--accent);
  color: #111925;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(255, 208, 0, 0.9); }

/* ==========================================================================
   文章详情
   ========================================================================== */
.post-page { flex: 1 1 auto; min-width: 0; }
.post-cover {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  background: #0b0f16;
}
.post-h1 {
  margin: 32px 0 14px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.2px;
}
.post-page > .post-meta { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.post-page > .post-meta .post-tags { margin-left: auto; }

.post-content { font-size: 16px; line-height: 1.62; color: var(--text); }
.post-content > *:first-child { margin-top: 28px; }
.post-content p { margin: 16px 0; }
.post-content h2 {
  margin: 44px 0 16px;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.2px;
}
.post-content h3 {
  margin: 34px 0 12px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
}
.post-content h4 { margin: 26px 0 10px; font-size: 17.5px; font-weight: 600; }
.post-content a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 208, 0, 0.5);
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease);
}
.post-content a:hover { color: var(--text); }
.post-content strong { font-weight: 600; }
.post-content ul, .post-content ol { margin: 16px 0; padding-left: 24px; }
.post-content li { margin: 8px 0; }
.post-content li::marker { color: var(--text-4); }
.post-content hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }
.post-content blockquote {
  margin: 24px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--bg-soft);
  color: var(--text-2);
}
.post-content blockquote p { margin: 6px 0; }
.post-content blockquote strong { color: var(--text); }
.post-content img { border-radius: 6px; margin: 24px 0; }
.md-figure { margin: 26px 0; }
.md-figure img { margin: 0; }
.md-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--text-4); text-align: center; }

.post-content code {
  font-family: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--tag-bg);
  color: var(--text);
}
.post-content :not(pre) > code { white-space: nowrap; }

/* 代码块 */
.code-block {
  margin: 24px 0;
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.code-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}
.code-lang { font-size: 11.5px; letter-spacing: 0.6px; color: rgba(255, 255, 255, 0.42); text-transform: uppercase; }
.code-copy {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.code-copy:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.code-copy.is-done { color: var(--accent); }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 2;
}
.code-block code {
  background: none; padding: 0; border-radius: 0;
  font-family: 'SF Mono', ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  color: #d7dee8;
  font-size: inherit;
  white-space: pre;
}

/* 表格 */
.table-wrap { margin: 24px 0; overflow-x: auto; border-radius: 6px; border: 1px solid var(--line); }
.post-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.post-content thead th {
  background: #111925;
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}
[data-theme='dark'] .post-content thead th { background: rgba(255, 255, 255, 0.1); }
.post-content td {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: top;
}
.post-content tbody tr:hover { background: var(--bg-soft); }

.heading-anchor {
  float: left;
  margin-left: -0.85em;
  width: 0.85em;
  color: var(--accent-ink);
  opacity: 0;
  text-decoration: none !important;
  font-weight: 400;
  transition: opacity 0.15s var(--ease);
}
.post-content h2:hover .heading-anchor,
.post-content h3:hover .heading-anchor { opacity: 1; }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--line);
}
.post-nav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.18s var(--ease);
}
.post-nav-item small { font-size: 12px; color: var(--text-4); }
.post-nav-item span { font-size: 14.5px; font-weight: 500; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.post-nav-item.next { text-align: right; align-items: flex-end; }
.post-nav-item.is-empty { border: 0; background: none; }

.post-side { position: sticky; top: calc(var(--header-h) + 24px); }

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 40px;
  padding: 44px 0 28px;
}
.brand--footer .brand-name { font-size: 16px; }
.footer-slogan { margin: 12px 0 0; font-size: 13.5px; color: var(--text-4); letter-spacing: 0.6px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 28px; padding-top: 6px; }
.footer-nav a { font-size: 14px; color: var(--text-3); transition: color 0.15s var(--ease); }
.footer-nav a:hover { color: var(--accent-ink); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0 32px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-4);
}
.footer-built { letter-spacing: 0.3px; }

/* ==========================================================================
   悬浮工具
   ========================================================================== */
.floating-tools {
  position: fixed; right: 24px; bottom: 28px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 50;
}
.float-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text-3);
  box-shadow: var(--shadow-sm);
  transition: all 0.18s var(--ease);
}
.float-btn:hover { color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.float-btn--top { opacity: 0; visibility: hidden; transform: translateY(6px); }
.float-btn--top.is-visible { opacity: 1; visibility: visible; transform: none; }
.theme-icon { display: grid; place-items: center; }
[data-theme='light'] .theme-icon--sun { display: none; }
[data-theme='dark'] .theme-icon--moon { display: none; }

/* ==========================================================================
   搜索面板
   ========================================================================== */
.search-panel { position: fixed; inset: 0; z-index: 100; }
.search-panel-mask { position: absolute; inset: 0; background: rgba(17, 25, 37, 0.42); backdrop-filter: blur(3px); }
.search-dialog {
  position: relative;
  width: min(660px, calc(100% - 32px));
  margin: 12vh auto 0;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: dialog-in 0.22s var(--ease);
}
@keyframes dialog-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.search-field {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text-4);
}
.search-field input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: none;
  font-size: 17px; color: var(--text);
  font-family: inherit;
}
.search-field input::placeholder { color: var(--text-4); }
.search-results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.search-hint { margin: 0; padding: 18px 12px; font-size: 13.5px; color: var(--text-4); }
.search-result {
  display: flex; gap: 14px; align-items: center;
  padding: 12px;
  border-radius: 8px;
  transition: background-color 0.15s var(--ease);
}
.search-result:hover, .search-result.is-selected { background: var(--bg-soft); }
.search-result img { width: 56px; height: 38px; border-radius: 4px; object-fit: cover; flex: none; }
.search-result-main { min-width: 0; }
.search-result-title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.search-result-meta { font-size: 12px; color: var(--text-4); display: flex; gap: 10px; }
.search-result mark { background: var(--accent-soft); color: var(--text); border-radius: 2px; }
.search-empty { padding: 36px 12px; text-align: center; color: var(--text-4); font-size: 14px; }

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1240px) {
  .home, .layout { gap: 44px; }
  .hero { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); height: auto; }
  .carousel { height: auto; aspect-ratio: 3 / 2; }
  .hot-list { height: 100%; }
  .hot-item { height: auto; flex: 1; }
}

@media (max-width: 1080px) {
  .sidebar { display: none; }
  .home, .layout { gap: 0; }
  .search-trigger { width: 180px; }
}

@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .hero { grid-template-columns: 1fr; gap: 20px; margin-bottom: 32px; }
  .carousel { aspect-ratio: 16 / 10; }
  .hot-list { display: grid; grid-template-columns: 1fr; height: auto; }
  .hot-item { height: auto; padding: 10px 10px 10px 12px; }
  .main-nav { display: none; }
  .main-nav.is-open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    height: auto;
    padding: 8px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .main-nav.is-open a { height: 46px; width: 100%; font-size: 15.5px; }
  .main-nav.is-open a::after { display: none; }
  .mobile-only.icon-btn { display: grid; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; border: 0; }
  .search-trigger span { display: none; }
  .post-h1 { font-size: 26px; margin-top: 24px; }
  .post-content h2 { font-size: 22px; }
  .post-content h3 { font-size: 18.5px; }
  .post-thumb { width: 112px; height: 76px; }
  .post-title { font-size: 17.5px; }
  .post-desc { font-size: 14px; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 560px) {
  .post-thumb { display: none; }
  .post-row { padding: 22px 0; }
  .post-meta { gap: 14px; font-size: 12.5px; }
  .brand-name { font-size: 15.5px; }
  .floating-tools { right: 14px; bottom: 16px; }
  .post-nav { grid-template-columns: 1fr; }
  .archive-tags { display: none; }
  .car-dots {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
  }
}

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