/* ============================================================
   base.css — 整页样式 / 设计系统
   风格：Claude（Anthropic）风格 —— 暖白底色 · 珊瑚橙强调 · 编辑感衬线标题 · 明暗双主题
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 字体 */
  --font-serif: "Newsreader", "Iowan Old Style", "Source Serif 4", Georgia, "Songti SC", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* 间距基准（8pt 节奏） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --space-10: 64px;
  --space-12: 96px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(33, 31, 28, 0.05), 0 1px 3px rgba(33, 31, 28, 0.04);
  --shadow-md: 0 6px 18px rgba(33, 31, 28, 0.08), 0 2px 6px rgba(33, 31, 28, 0.05);
  --shadow-lg: 0 18px 48px rgba(33, 31, 28, 0.14);

  /* 过渡 */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms var(--ease);
  --t-normal: 260ms var(--ease);

  --maxw: 1080px;
  --maxw-read: 760px;
}

/* 明主题（默认） */
:root,
[data-theme="light"] {
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f0ea;
  --surface-3: #ece8e0;
  --text: #211f1c;
  --text-2: #5c5750;
  --text-3: #736f68;
  --border: #e6e1d8;
  --border-strong: #d6cfc2;
  /* --accent 用于装饰（渐变、边框、图标底色）；
     --accent-text 才是「作为文字」的强调色，保证对比度 ≥ 4.5:1 */
  --accent: #d97757;
  --accent-text: #a94f28;
  --accent-hover: #8f4520;
  --accent-strong: #b4532a;
  --accent-soft: #f7e9e2;
  --accent-contrast: #ffffff;
  --code-bg: #2b2a27;
  --code-text: #f4f1ec;
  --selection: rgba(217, 119, 87, 0.22);
}

/* 暗主题 */
[data-theme="dark"] {
  --bg: #1b1a17;
  --surface: #232220;
  --surface-2: #2a2925;
  --surface-3: #32302b;
  --text: #ece8e1;
  --text-2: #b3ada2;
  --text-3: #8f8a7e;
  --border: #35332e;
  --border-strong: #45423b;
  --accent: #e89b7d;
  --accent-text: #f0ad92;
  --accent-hover: #f7c3ac;
  --accent-strong: #e89b7d;
  --accent-soft: #3a2a22;
  --accent-contrast: #1b1a17;
  --code-bg: #141310;
  --code-text: #f4f1ec;
  --selection: rgba(232, 155, 125, 0.26);
}

/* ---------- 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

::selection { background: var(--selection); }

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

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

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--read { max-width: var(--maxw-read); }

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

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-4);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  color: var(--text);
}
.brand:hover { color: var(--text); }

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: grid;
  place-items: center;
  color: var(--accent-contrast);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}

.nav-actions { display: flex; align-items: center; gap: var(--space-2); }

/* 图标按钮 */
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--t-fast);
}
.icon-btn:hover {
  color: var(--accent-text);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: block; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }

/* 语言切换 */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--t-fast);
}
.lang-switch button[aria-pressed="true"] {
  background: var(--accent-strong);
  color: var(--accent-contrast);
}

/* ---------- 首页 Hero ---------- */
.hero {
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
}
.hero__eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-4);
}
.hero__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}
.hero__subtitle {
  font-size: 1.12rem;
  color: var(--text-2);
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: var(--space-8) 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
}
.section-head .count {
  font-size: 0.85rem;
  color: var(--text-3);
}

/* ---------- 文章卡片网格 ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-5);
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  position: relative;
  overflow: hidden;
}
/* 卡片整体作为链接命中区 */
.post-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}
.post-card__link:hover { color: inherit; }
/* 文章数量少时收窄，避免右侧大片留白 */
.post-grid > .post-card:only-child {
  grid-column: 1 / -1;
  max-width: 560px;
}
.post-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.post-card:hover::before { opacity: 1; }

.post-card__cat {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  margin-bottom: var(--space-2);
}
.post-card__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.3;
  margin: 0 0 var(--space-3);
  color: var(--text);
}
.post-card__summary {
  color: var(--text-2);
  font-size: 0.95rem;
  margin: 0 0 var(--space-4);
  flex: 1;
}
.post-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-3);
}
.post-card__lang {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---------- 标签 ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag {
  font-size: 0.78rem;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  transition: all var(--t-fast);
}
.tag:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- 文章页 ---------- */
.article-head {
  padding: var(--space-6) 0 var(--space-5);
  border-bottom: 1px solid var(--border);
}
.article-head .back-link { margin: 0 0 var(--space-5); }
.article-head__cat {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: var(--space-3);
}
.article-head__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.18;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}
.article-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-3);
  font-size: 0.88rem;
}
.article-head__tags { margin-top: var(--space-3); }
.article-head__source { margin-top: var(--space-3); font-size: 0.88rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  margin: var(--space-6) 0;
}
.back-link:hover { color: var(--accent-text); }
.back-link svg { width: 16px; height: 16px; }

/* ---------- 骨架屏 / 加载 ---------- */
.loading {
  text-align: center;
  color: var(--text-3);
  padding: var(--space-10) 0;
  font-family: var(--font-serif);
  font-style: italic;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: var(--space-12);
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
  color: var(--text-3);
  font-size: 0.88rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}
.site-footer a { color: var(--text-2); }

/* ---------- 工具类 ---------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .container { padding-inline: var(--space-4); }
  .hero { padding: var(--space-8) 0 var(--space-6); }
  .post-grid { grid-template-columns: 1fr; }
  .brand__name-long { display: none; }
}

/* ---------- 降低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   交互组件：进度条 / 搜索 / 分类 / 目录 / 代码复制 / 上下篇 / 回到顶部
   ============================================================ */

/* ---------- 阅读进度条 ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 100;
  pointer-events: none;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 90ms linear;
}

/* ---------- 站内搜索 ---------- */
.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.search__field { position: relative; width: 100%; }
.search__icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
}
#search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
#search-input::placeholder { color: var(--text-3); }
#search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#search-input::-webkit-search-cancel-button { cursor: pointer; }
.search__toggle { display: none; flex: none; }

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 60;
}
.search-panel.is-open { display: block; }
.search-panel__list { list-style: none; margin: 0; padding: 6px; }
.search-panel__list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
}
.search-panel__list a:hover { background: var(--surface-2); color: var(--text); }
.search-panel__title { font-size: 0.92rem; font-weight: 500; }
.search-panel__cat { font-size: 0.75rem; color: var(--text-3); }
.search-panel__empty { padding: 14px 16px; font-size: 0.88rem; color: var(--text-3); }

/* ---------- 分类筛选芯片 ---------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.chip {
  font-family: inherit;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--accent); color: var(--accent-text); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-10) 0;
  color: var(--text-2);
}
.empty-state p { margin: 0 0 6px; font-size: 1.05rem; }
.empty-state small { color: var(--text-3); }

/* ---------- 文章布局 + 目录 ---------- */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "head"
    "side"
    "body";
  row-gap: var(--space-5);
}
.article-head { grid-area: head; }
.article-side { grid-area: side; min-width: 0; }
.article-body { grid-area: body; min-width: 0; }

/* 目录：移动端为可折叠卡片，桌面端为右侧固定栏 */
.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.toc__title {
  cursor: pointer;
  list-style: none;
  padding: var(--space-3) var(--space-4);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--t-fast);
}
.toc[open] .toc__title::after { transform: rotate(-135deg) translateY(-2px); }
.toc__title:hover { color: var(--accent-text); }

.toc__list {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-4) var(--space-4);
  border-left: 1px solid var(--border);
  margin-left: var(--space-4);
}
.toc__item a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-2);
  transition: color var(--t-fast), border-color var(--t-fast);
}
.toc__item a:hover { color: var(--accent-text); }
.toc__item a.is-active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  font-weight: 500;
}
.toc__item--h3 a { padding-left: 26px; font-size: 0.82rem; }

/* ---------- 代码块复制按钮 ---------- */
.code-wrap { position: relative; margin: 1.4em 0; }
.code-wrap pre { margin: 0; }
.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: #e8e3da;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast);
}
.code-wrap:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.copy-btn.is-done { color: #8fd6a8; border-color: rgba(143, 214, 168, 0.4); }

/* ---------- 上下篇导航 ---------- */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: all var(--t-fast);
}
.post-nav__item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.post-nav__item--next { text-align: right; }
.post-nav__label { font-size: 0.76rem; color: var(--text-3); }
.post-nav__title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--text);
}

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--t-normal);
  z-index: 40;
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { color: var(--accent-text); border-color: var(--accent); }
.back-top svg { width: 18px; height: 18px; }

/* ---------- 组件响应式 ---------- */
@media (min-width: 1100px) {
  /* 桌面：标题整行，正文与目录并排，目录固定跟随滚动 */
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 218px;
    grid-template-areas:
      "head head"
      "body side";
    column-gap: var(--space-10);
    row-gap: var(--space-6);
  }
  .article-body { max-width: 800px; }
  .article-side {
    position: sticky;
    top: 96px;
    align-self: start;
    max-height: calc(100vh - 132px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* 桌面端目录为纯净侧栏，不需要折叠卡片外观 */
  .toc {
    border: none;
    background: none;
    border-radius: 0;
    overflow: visible;
  }
  .toc__title {
    padding: 0 0 var(--space-3);
    cursor: default;
  }
  .toc__title:hover { color: var(--text-3); }
  .toc__title::after { display: none; }
  .toc__list {
    padding: 0 0 0 var(--space-4);
    margin-left: 0;
  }
}

@media (max-width: 860px) {
  .site-header__inner { position: relative; }
  .search { max-width: none; justify-content: flex-end; }
  .search__field { display: none; }
  .search__toggle { display: inline-grid; }
  .search--open {
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--space-4);
  }
  .search--open .search__field { display: block; }
  .search--open .search-panel {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    margin-top: var(--space-2);
  }
  .search--open .search-panel.is-open {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-top: var(--space-2);
  }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { text-align: left; }
}

/* ============================================================
   目录树视图（tree）—— 首页按 blog/ 的真实目录层级展示
   ============================================================ */
.tree-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-sm);
}
.tree,
.tree__children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree__children { margin-left: 18px; border-left: 1px dashed var(--border); padding-left: 10px; }
.tree__item { margin: 1px 0; }

.tree__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: 2px 8px 2px 2px;
  border-radius: var(--radius-md);
  transition: background var(--t-fast);
}
.tree__row:hover { background: var(--surface-2); }

.tree__toggle {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-3);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.tree__toggle:hover { color: var(--accent-text); background: var(--surface-3); }
.tree__toggle--leaf { cursor: default; }
.tree__chev { width: 13px; height: 13px; transition: transform var(--t-fast); }
.tree__toggle[aria-expanded="true"] .tree__chev { transform: rotate(90deg); }

.tree__icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--text-3);
}
.tree__row--post .tree__icon { color: var(--accent); }

.tree__name {
  flex: 0 1 auto;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
  white-space: nowrap;
}

.tree__post {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--text-2);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree__post:hover { color: var(--accent-text); text-decoration: underline; }

.tree__date {
  flex: 0 0 auto;
  font-size: 0.78rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.tree__enter {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: 0.76rem;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.tree__enter:hover { border-color: var(--accent); color: var(--accent-text); }

.tree__count {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}

/* 移动端：收紧缩进，日期与「进入」按钮让位 */
@media (max-width: 640px) {
  .tree-wrap { padding: var(--space-2); border-radius: var(--radius-md); }
  .tree__children { margin-left: 10px; padding-left: 8px; }
  .tree__row { gap: var(--space-1); min-height: 34px; padding-right: 2px; }
  .tree__date { display: none; }
  .tree__name { font-size: 0.88rem; white-space: normal; }
  .tree__post { font-size: 0.84rem; white-space: normal; }
  .tree__enter { padding: 2px 7px; font-size: 0.72rem; }
}

/* ---------- 目录路径（面包屑） ---------- */
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0 0 var(--space-4);
  font-size: 0.88rem;
  color: var(--text-3);
}
.crumb__item {
  font-family: inherit;
  font-size: inherit;
  border: 0;
  background: none;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
a.crumb__item { text-decoration: none; }
.crumb__item:hover { color: var(--accent-text); background: var(--surface-2); }
.crumb__item.is-current { color: var(--text); font-weight: 600; cursor: default; }
.crumb__item.is-current:hover { background: none; }
.crumb__sep { color: var(--text-3); opacity: 0.55; }
