/* ============================================================
   小核桃工作室 · 个人博客
   风格参照 deepseek.com/harness —— 纯黑底 / 蓝色强调 / 玻璃卡片
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #000000;
  --bg-panel: #101113;
  --bg-panel-2: #16181d;
  --bg-code: #0c0d0f;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-1: #e6e8ea;
  --text-2: #a3a8b0;
  --text-3: #81858c;

  --accent: #679efe;
  --accent-bright: #8ab4ff;
  --accent-dim: rgba(103, 158, 254, 0.14);
  --accent-border: rgba(103, 158, 254, 0.32);

  --glow-deep: #1a3870;
  --glow-mid: #2d5f9e;
  --glow-hi: #4a8ac4;

  /* hero 渐变起色 + 文本强/代码字/成功/按钮主文字 */
  --grad-start: #3ec2dd;
  --text-strong: #ffffff;
  --code-text: #cdd3da;
  --success: #28c840;
  --btn-on-primary: #0b0d12;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "Cascadia Code", "Cascadia Mono", ui-monospace, "JetBrains Mono",
    Consolas, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-xs: 6px;   /* 散装 4 / 6 / 7 / 8 / 9 px 的归位（图标按钮、tag、小卡片） */
  --radius-pill: 999px; /* 胶囊形（hero h1 占位 / 角标） */
  --container: 1120px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* 全站细主题滚动条（Firefox）；各组件的更窄条按自身选择器覆盖 */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* 全站细主题滚动条（WebKit / Chromium / Edge） */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

::selection {
  background: rgba(103, 158, 254, 0.35);
  color: var(--text-1);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 键盘 / 屏读用户跳过 nav 直达主内容 */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--btn-on-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.2s var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 16px;
  outline: 2px solid var(--text-1);
  outline-offset: 2px;
}

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

.mono {
  font-family: var(--font-mono);
}

/* 小节眉标：$ ls ~/posts —— 代码注释式 kicker */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 18px;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-head {
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.section-head .sub {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 15px;
  max-width: 560px;
}

.section {
  padding: 96px 0;
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* ---------- 星尘粒子背景层（JS 注入，位于内容之下） ---------- */
#dust-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- 滚动进场（对齐 harness 的 --enter-y / --enter-blur） ----------
   仅在 JS 可用（html.js）时才应用初始隐藏，保证无 JS 时内容照常可见 */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  filter: blur(8px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out),
    filter 0.8s var(--ease-out);
  transition-delay: var(--d, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 6px 5px;
  margin: -6px -5px; /* 视觉不占位，但点击区 ≥44px */
  border-radius: var(--radius);
}

.brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a.active {
  color: var(--accent-bright);
}

.nav-links a.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.nav-links a.nav-cta:hover {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.nav-links svg {
  width: 15px;
  height: 15px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  overflow: hidden;
}

/* 深蓝辉光背景 —— 复刻 harness 的 radial-gradient 光斑 */
.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-glow::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -160px;
  width: 780px;
  height: 780px;
  background: radial-gradient(circle, rgba(45, 95, 158, 0.34) 0%, rgba(26, 56, 112, 0.18) 40%, transparent 70%);
}

.hero-glow::after {
  content: "";
  position: absolute;
  bottom: -260px;
  left: -180px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(26, 56, 112, 0.28) 0%, transparent 70%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58fr 42fr;
  align-items: center;
  gap: 48px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 26px;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero h1 {
  font-size: clamp(38px, 6.4vw, 64px);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.02em;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--grad-start) 0%, var(--accent) 55%, var(--glow-hi) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-desc {
  margin-top: 22px;
  max-width: 520px;
  color: var(--text-2);
  font-size: 16.5px;
}

.hero-desc .formula {
  font-family: var(--font-mono);
  color: var(--text-1);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 8px;
  white-space: nowrap;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 34px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.22s var(--ease-out), color 0.22s var(--ease-out), border-color 0.22s var(--ease-out), transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-on-primary);
  font-weight: 600;
  box-shadow: 0 0 0 rgba(103, 158, 254, 0);
}

.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 0 6px 26px rgba(103, 158, 254, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-1);
}

.btn-secondary:hover {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

/* ---------- 工作室口号 ---------- */
.hero-motto {
  display: flex;
  align-items: center;
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.32em;
  color: var(--text-2);
}

.hero-motto i {
  font-style: normal;
  margin: 0 16px;
  letter-spacing: 0;
  color: var(--accent);
}

/* ---------- Hero 右侧画布 ---------- */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

#orbit-canvas {
  width: min(100%, 520px);
  aspect-ratio: 1;
  mix-blend-mode: screen;
}

/* ---------- 理念三栏（对齐 harness 理念区） ---------- */
.concept {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.concept-item {
  border-left: 1px solid var(--border-strong);
  padding-left: 20px;
}

.concept-item .no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.concept-item h3 {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 600;
}

.concept-item p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.75;
}

/* ---------- 文章列表 ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* noscript 兜底列表（JS 被禁用时显示） */
.fallback-list {
  padding-left: 22px;
}

.fallback-list li {
  margin: 7px 0;
}

.fallback-list a {
  color: var(--accent-bright);
}

/* 「查看全部文章」入口：复用 .btn .btn-primary（与首页「阅读文章」同款蓝色实心），
   这里只补列表区块需要的间距和隐藏逻辑 */
.all-posts-link,
.all-projects-link {
  margin-top: 28px;
}

.all-posts-link[hidden],
.all-projects-link[hidden] {
  display: none;
}

/* ---------- 文章页侧栏（文章导航） ----------
   默认隐藏，宽屏（>1100px）且页面带 .post-sidebar 时启用双栏 */
.post-sidebar {
  display: none;
}

.post-sidebar .kicker {
  display: block;
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  /* 独立滚动：滚到头不带动整页，滚动条只在列表高过可用高度时出现 */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.side-list::-webkit-scrollbar {
  width: 5px;
}

.side-list::-webkit-scrollbar-track {
  background: transparent;
}

.side-list::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.side-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

.side-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  transition: background 0.2s;
}

.side-item .d {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.side-item .t {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}

.side-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.side-item:hover .t {
  color: var(--text-1);
}

.side-item.current {
  background: var(--accent-dim);
}

.side-item.current .t {
  color: var(--accent-bright);
}

.side-item.current .d {
  color: var(--accent);
}

.side-all {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-3);
  transition: color 0.2s;
}

.side-all:hover {
  color: var(--accent-bright);
}

/* 目录：仅在 JS 注入且 .prose 含 ≥2 个 h2/h3 时挂 .side-toc，复用侧栏的限高滚动 */
.side-toc {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.side-toc::-webkit-scrollbar { width: 4px; }
.side-toc::-webkit-scrollbar-track { background: transparent; }
.side-toc::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}
.side-toc .toc-h {
  display: block;
  padding: 4px 8px;
  color: var(--text-3);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.side-toc .toc-h:hover { color: var(--text-1); background: var(--bg-panel-2); }
.side-toc .toc-h.lv-3 { padding-left: 22px; font-size: 11.5px; }
.side-toc .toc-h.current {
  color: var(--accent);
  border-left-color: var(--accent);
}
.side-toc .toc-h.current:hover { color: var(--accent-bright); }

@media (min-width: 1101px) {
  .post-page .container:has(.post-sidebar) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    grid-template-areas:
      "back side"
      "article side"
      "nav side"
      "comments comments";
    column-gap: 56px;
    align-items: start;
  }

  .post-page .container:has(.post-sidebar) .back-link {
    grid-area: back;
  }

  .post-page .container:has(.post-sidebar) .article {
    grid-area: article;
  }

  .post-page .container:has(.post-sidebar) .post-nav {
    grid-area: nav;
  }

  .post-page .container:has(.post-sidebar) .comments {
    grid-area: comments;
    max-width: 720px;  /* 与 .article 同宽，跨两列后限制阅读宽度 */
  }

  .post-page .container:has(.post-sidebar) .post-sidebar {
    display: flex;
    flex-direction: column;
    grid-area: side;
    position: sticky;
    top: 96px;
    /* 限高在视口内：标题和「全部文章」常驻，中间列表自己滚 */
    max-height: calc(100vh - 120px);
  }

  .post-page .container:has(.post-sidebar) .side-list {
    flex: 1;
    min-height: 0;
    /* 约可见 8 行，再高的部分用滚轮看；矮视口时让位给可用高度 */
    max-height: 456px;
    overflow-y: auto;
    padding-right: 5px;
  }
  /* 目录挂上后：两个列表平分侧栏可用高度，避免任一被单独 max-height 卡死 */
  .post-page .container:has(.post-sidebar) .post-sidebar:has(.side-toc) .side-list {
    max-height: none;
  }
}

.post-card {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 26px;
  align-items: baseline;
  padding: 26px 28px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s var(--ease-out),
    background 0.25s;
}

.post-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-panel-2);
  transform: translateY(-2px);
}

.post-card .date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
}

/* 置顶标记 */
.pin-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 1.5px 8px;
}

.post-card h3 {
  font-size: 17.5px;
  font-weight: 600;
  line-height: 1.45;
}

.post-card .excerpt {
  margin-top: 7px;
  font-size: 14px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .meta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.post-card .arrow {
  color: var(--text-3);
  transition: color 0.2s, transform 0.25s var(--ease-out);
  font-family: var(--font-mono);
  font-size: 15px;
}

.post-card:hover .arrow {
  color: var(--accent-bright);
  transform: translateX(4px);
}

/* ---------- 标签 ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  padding: 2.5px 11px;
  white-space: nowrap;
}

.tag-gray {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
}

/* ---------- 项目卡片 ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.project-card {
  position: relative;
  display: block;
  padding: 30px 30px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.015) 45%,
    rgba(255, 255, 255, 0.03) 100%
  );
  transition: border-color 0.25s, transform 0.25s var(--ease-out),
    box-shadow 0.25s;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 158, 254, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.project-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card .p-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent-bright);
  margin-bottom: 20px;
}

.project-card .p-icon svg {
  width: 20px;
  height: 20px;
}

.project-card h3 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 卡片右上角的更新日期（mono 小字，与文章日期同风格） */
.project-card .p-date {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-3);
}

.project-card .p-desc {
  margin-top: 9px;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.75;
  min-height: 49px;
}

.project-card .p-foot {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card .p-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  transition: color 0.2s;
}

.project-card:hover .p-link {
  color: var(--accent-bright);
}

/* ---------- 联系方式 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.contact-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}

.contact-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
}

.contact-card .c-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.contact-card .c-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text-1);
}

.contact-card .c-icon svg {
  width: 19px;
  height: 19px;
}

.contact-card h3 {
  font-size: 15.5px;
  font-weight: 600;
}

.contact-card .c-sub {
  font-size: 12.5px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.contact-card .c-value {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-2);
  word-break: break-all;
}

.contact-card .qr-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  max-width: 168px;
}

.contact-card .qr-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 46px 0 42px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.footer-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.footer-brand .n {
  font-size: 14.5px;
  font-weight: 600;
}

.footer-brand .s {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.16em;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 13.5px;
  color: var(--text-3);
}

.footer-links a {
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-1);
}

.footer-caption {
  margin-top: 26px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ============================================================
   文章页
   ============================================================ */
.post-page {
  padding: 132px 0 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-3);
  transition: color 0.2s;
  margin-bottom: 40px;
}

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

.article {
  max-width: 720px;
}

.article-head {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 44px;
}

.article-head .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 20px;
}

.article-head .meta .sep {
  opacity: 0.5;
}

.article-head h1 {
  font-size: clamp(27px, 4.4vw, 40px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.article-head .standfirst {
  margin-top: 18px;
  color: var(--text-2);
  font-size: 16px;
}

/* ---------- 正文排版 ---------- */
.prose {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-1);
}

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

.prose h2 {
  margin-top: 2.2em;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.01em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 19px;
  font-weight: 600;
}

.prose a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-decoration-color: rgba(103, 158, 254, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.prose a:hover {
  text-decoration-color: var(--accent-bright);
}

.prose strong {
  color: var(--text-strong);
  font-weight: 650;
}

.prose ul,
.prose ol {
  padding-left: 1.5em;
  display: flex;
  flex-direction: column;
  gap: 0.45em;
}

.prose ul { list-style: none; }

.prose ul > li {
  position: relative;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: -1.15em;
  top: 0.78em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
}

.prose ol {
  list-style: decimal;
}

.prose ol > li::marker {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1.5px 6.5px;
  color: var(--accent-bright);
}

.prose pre {
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.prose pre .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  padding: 8px 12px;
  min-height: 28px; /* 让上下 padding 撑到 44 不算美观，留文字小一点；移动端覆盖 */
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
@media (max-width: 640px) {
  .copy-btn {
    min-height: 44px;
    padding: 12px 14px;
  }
}

.copy-btn:hover {
  color: var(--text-1);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.copy-btn.copied {
  color: var(--success);
}

.prose pre code {
  display: block;
  padding: 18px 20px;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--code-text);
  overflow-x: auto;
}

.prose blockquote {
  border-left: 2.5px solid var(--accent);
  padding: 6px 0 6px 20px;
  color: var(--text-2);
}

.prose blockquote p + p {
  margin-top: 0.6em;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.prose th {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 500;
}

/* 游戏名单（tier + 双语条目） */
.prose .tier-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2.2em;
}

.prose .tier-head h2 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.tier-badge {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 700;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.tier-badge.tier-s {
  background: var(--accent-dim);
  color: var(--accent-bright);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 24px rgba(103, 158, 254, 0.18);
}

.tier-badge.tier-a {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
}

.prose ul.game-list {
  padding-left: 0;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 13px 26px;
}

/* 熟练度分组标签：精通 > 熟练 > 玩过 > 了解 */
.prose .prof-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  padding: 3.5px 14px;
  border-radius: var(--radius-pill);
  margin: 26px 0 16px;
}

.prof-lv1 {
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}

.prof-lv2 {
  color: var(--accent-bright);
  background: rgba(103, 158, 254, 0.07);
  border: 1px solid rgba(103, 158, 254, 0.18);
}

.prof-lv3 {
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
}

.prof-lv4 {
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
}

.prose ul.game-list > li::before {
  content: none;
}

.game-list .zh {
  font-size: 15.5px;
  font-weight: 500;
}

.game-list .en {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* 长篇小说页：署名 / 目录 / 词条 / 文字表格 */
.prose .novel-byline {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

/* 剧本里的括号行（舞台指示 / 镜头说明）：弱化为次要色 */
.prose p.stage {
  color: var(--text-3);
}

/* ---------- 文章搜索 ---------- */
.post-search {
  position: relative;
  margin-bottom: 24px;
}

.post-search .s-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}

.post-search input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 42px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-1);
  font-family: var(--font-mono);
  /* 16px 防止 iOS Safari / Android WebView 在 focus 时自动 zoom viewport */
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-search input::placeholder {
  color: var(--text-3);
}

.post-search input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-hint {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-3);
}

.search-hint b {
  color: var(--accent-bright);
  font-weight: 600;
}

.search-empty {
  padding: 34px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

/* ---------- 主题切换按钮 ---------- */
/* View Transitions（主题切换）：在 html.theme-anim 作用域内关闭默认交叉淡化，圆形扩散由 JS 驱动；
   加作用域是为了不影响跨页面过渡（见文件末尾的「跨页面过渡」） */
html.theme-anim::view-transition-old(root),
html.theme-anim::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* 导航栏全局搜索：放大镜按钮原地扩展为搜索框，结果下拉浮层 */
.nav-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 44px; /* 收起时只占按钮宽，input 用 absolute 浮出 */
  height: 44px; /* 44px 触摸目标 */
  margin-left: 4px;
  transition: width 0.22s var(--ease-out);
}
.nav-search.open {
  width: 600px;
}
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, opacity 0.18s;
  flex-shrink: 0;
}
.nav-search-btn:hover {
  color: var(--text-1);
  border-color: var(--accent-border);
}
.nav-search-btn svg {
  width: 15px;
  height: 15px;
}
/* 打开时按钮让位给输入框（圆框淡出，输入框从右滑入）。
   input 用 position: absolute 从 nav 流里浮出，避免参与 nav 内布局；
   展开/收起走 clip-path：不变形文字、不重复触发 reflow（width 一次性切到 600）。 */
.nav-search-input {
  position: absolute;
  top: 0;
  left: 44px; /* 按钮右侧 */
  right: 0;
  height: 44px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-xs);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 13.5px;
  outline: none;
  opacity: 0;
  clip-path: inset(0 100% 0 0); /* 从右往左收：右侧裁掉 */
  transition: clip-path 0.22s var(--ease-out), opacity 0.18s var(--ease-out), border-color 0.2s, background 0.2s;
}
/* 展开后按钮退化为输入框内的放大镜图标（样式对齐项目页的大搜索框） */
.nav-search.open .nav-search-btn {
  position: absolute;
  left: 54px; /* wrap 坐标系：input 左缘在 +44px + padding-left 12px → 56px */
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-color: transparent;
  background: transparent;
  color: var(--text-3);
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}
.nav-search.open .nav-search-btn svg {
  width: 16px;
  height: 16px;
}
.nav-search.open .nav-search-input {
  opacity: 1;
  clip-path: inset(0 0 0 0); /* 完全可见 */
}
.nav-search.open .nav-search-input:focus {
  border-color: var(--accent-border);
  background: rgba(255, 255, 255, 0.06);
}
/* 收起时值/占位符立刻隐藏（opacity 不参与 clip-path 过渡时序），避免闪烁；
   展开仍走上面的渐显 */
.nav-search:not(.open) .nav-search-input {
  transition: clip-path 0.22s var(--ease-out), border-color 0.2s, background 0.2s;
}

/* 下拉浮层：导航栏下方浮窗，显示实时结果。
   注意：必须挂在 body 下用 fixed 定位——panel 若留在 .nav（backdrop-filter）子树里，
   Chromium 会跳过其内部元素的 VT 快照，搜索结果的共享元素过渡会失效。
   top 58 = 导航 64px 内输入框底缘（52px）+ 6px 间距；圆角与输入框一致 6px */
.nav-search-results {
  position: fixed;
  top: 58px;
  right: 12px;
  width: 540px;
  max-width: calc(100vw - 24px);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  padding: 14px;
  z-index: 101;
  /* 文章 + 项目两组结果可能较长，浮层自己滚（细主题滚动条，同侧栏） */
  max-height: min(60vh, 540px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  /* 出现/消失用 opacity 微动画，不动布局 */
  animation: nav-search-pop 0.18s var(--ease-out) both;
}
.nav-search-results::-webkit-scrollbar {
  width: 5px;
}
.nav-search-results::-webkit-scrollbar-track {
  background: transparent;
}
.nav-search-results::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}
.nav-search-results::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}
@keyframes nav-search-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* 浮层内的卡片更紧凑 */
.nav-search-results .post-card {
  min-height: 0;
  padding: 12px 14px;
}
.nav-search-results .post-card h3 {
  font-size: 14.5px;
}
.nav-search-results .post-card .excerpt {
  font-size: 12.5px;
  -webkit-line-clamp: 2;
}
/* 键盘选中态：accent 描边 */
.nav-search-results .post-card.focused {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
/* 分组眉标：沿用全站终端命令的叙事 */
.nav-search-label {
  margin: 12px 2px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.nav-search-results .search-hint + .nav-search-label { margin-top: 12px; }
.nav-search-results .search-hint { margin-bottom: 10px; }
/* 项目结果：紧凑单行（图标 / 标题+描述 / 外链文字） */
.nav-project {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-panel-2);
  color: var(--text-1);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.nav-project + .nav-project { margin-top: 8px; }
.nav-project:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.nav-project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}
.nav-project-icon svg {
  width: 15px;
  height: 15px;
}
.nav-project-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-project-title {
  font-size: 14px;
  font-weight: 600;
}
.nav-project-desc {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-project-link {
  font-size: 11.5px;
  color: var(--text-3);
  flex-shrink: 0;
}
.nav-project.focused {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
/* 全局搜索点项目跳转：全部项目页里目标卡片的高亮态（2.6s 后由 JS 摘掉） */
.project-card.highlight {
  border-color: var(--accent-border);
  background: var(--accent-dim);
}
/* 搜索展开时三个页面链接让位（JS 在 nav 上挂 nav-search-open），GitHub 入口保留。
   让位用 transform: scaleX(0) 收起，避开 max-width/padding 触发 nav 内 reflow；
   收起时延迟到输入框收完（0.22s）再渐显回来 */
.nav-links > a:not(.nav-cta) {
  transform-origin: center;
  transition: opacity 0.2s var(--ease-out), transform 0.22s var(--ease-out);
}
.nav-links.nav-search-open > a:not(.nav-cta) {
  opacity: 0;
  pointer-events: none;
  transform: scaleX(0);
}
.nav-links:not(.nav-search-open) > a:not(.nav-cta) {
  transition: opacity 0.25s var(--ease-out) 0.22s, transform 0.22s var(--ease-out) 0.22s;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.theme-toggle:hover {
  color: var(--text-1);
  border-color: var(--accent-border);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* 置顶徽标放进项目卡片右上角日期旁时的间距 */
.project-card .p-date .pin-badge {
  margin-left: 8px;
}

/* ---------- 亮色主题（html[data-theme="light"] 时生效） ---------- */
:root[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-panel: #ffffff;
  --bg-panel-2: #eef0f4;
  --bg-code: #f6f7f9;

  --border: rgba(16, 24, 40, 0.10);
  --border-strong: rgba(16, 24, 40, 0.20);

  --text-1: #171b22;
  --text-2: #454c56;
  --text-3: #6b727b;  /* 浅色主题：4.5:1 对比度（W3C AAA Large）边缘失败 → 5.0:1 过 AA 4.5:1 */

  --accent: #2f6ceb;
  --accent-bright: #1e56c8;
  --accent-dim: rgba(47, 108, 235, 0.10);
  --accent-border: rgba(47, 108, 235, 0.32);

  --glow-hi: #1e56c8;

  --grad-start: #1893b4;
  --text-strong: #171b22;
  --code-text: #3a4149;
  --success: #1aa64f;
  --btn-on-primary: #0b0d12;
}

:root[data-theme="light"] .nav { background: rgba(245, 246, 248, 0.82); }
:root[data-theme="light"] .nav-links a:hover { background: rgba(16, 24, 40, 0.06); }
:root[data-theme="light"] .nav-links a.nav-cta { background: rgba(16, 24, 40, 0.04); }
:root[data-theme="light"] .theme-toggle { background: rgba(16, 24, 40, 0.04); }
:root[data-theme="light"] .nav-search-btn { background: rgba(16, 24, 40, 0.04); }
:root[data-theme="light"] .nav-search.open .nav-search-input { background: rgba(16, 24, 40, 0.05); }
:root[data-theme="light"] .nav-search.open .nav-search-input:focus { background: rgba(16, 24, 40, 0.07); }
:root[data-theme="light"] .nav-search-results { box-shadow: 0 16px 40px rgba(16, 24, 40, 0.14); }
:root[data-theme="light"] .hero-glow::before {
  background: radial-gradient(circle, rgba(47, 108, 235, 0.10) 0%, rgba(47, 108, 235, 0.04) 40%, transparent 70%);
}
:root[data-theme="light"] .hero-glow::after {
  background: radial-gradient(circle, rgba(47, 108, 235, 0.07) 0%, transparent 70%);
}
:root[data-theme="light"] .hero-badge { background: rgba(16, 24, 40, 0.04); }
:root[data-theme="light"] .btn-secondary { background: rgba(16, 24, 40, 0.03); }
:root[data-theme="light"] .side-item:hover { background: rgba(16, 24, 40, 0.05); }
:root[data-theme="light"] .post-card,
:root[data-theme="light"] .project-card {
  background: var(--bg-panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
:root[data-theme="light"] .project-card:hover { box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14); }
:root[data-theme="light"] .prose code { background: rgba(16, 24, 40, 0.06); }
:root[data-theme="light"] .prose pre .code-head { background: rgba(16, 24, 40, 0.03); }
:root[data-theme="light"] .copy-btn:hover { background: rgba(16, 24, 40, 0.05); }
:root[data-theme="light"] .prof-lv2 {
  background: rgba(47, 108, 235, 0.08);
  border-color: rgba(47, 108, 235, 0.25);
}
:root[data-theme="light"] .tier-badge.tier-a { background: rgba(16, 24, 40, 0.04); }
/* 亮色模式下二维码反相成白底深色码（hue-rotate 保持蓝色系、不破坏可扫描性） */
:root[data-theme="light"] .contact-card .qr-box img {
  filter: invert(1) hue-rotate(180deg);
}

/* ---------- Giscus 评论区（文章页末尾） ---------- */
.comments {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.comments[hidden] {
  display: none;
}

.comments-head {
  margin-bottom: 24px;
}

.prose .chapter-nav-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 14px 20px;
}

.prose .chapter-nav-box summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  user-select: none;
}

.prose .chapter-nav-box[open] summary {
  margin-bottom: 14px;
}

.prose .chapter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chapter-nav a {
  font-size: 13px;
  color: var(--text-2);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chapter-nav a:hover {
  color: var(--accent-bright);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.prose .term-name {
  color: var(--accent-bright);
  font-weight: 550;
}

.prose .pipe {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 2;
  color: var(--text-3);
  overflow-x: auto;
  white-space: nowrap;
}

/* 文字表格（还原为两列对照表） */
.prose .pipe-table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prose .pipe-table th,
.prose .pipe-table td {
  border: 1px solid var(--border);
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  line-height: 1.75;
}

.prose .pipe-table th {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  white-space: nowrap;
}

.prose .pipe-table td {
  color: var(--text-1);
  min-width: 220px;
}

.prose .pipe-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.prose .pipe-table p {
  margin: 0;
}

/* 占位提示框 */
.placeholder-box {
  border: 1.5px dashed rgba(103, 158, 254, 0.4);
  border-radius: var(--radius);
  background: rgba(103, 158, 254, 0.05);
  padding: 26px 28px;
  color: var(--text-2);
  font-size: 14.5px;
}

.placeholder-box .ph-title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
  margin-bottom: 8px;
}

/* ---------- 文末导航 ---------- */
.post-nav {
  max-width: 720px;
  margin-top: 72px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.post-nav a {
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition: border-color 0.22s, background 0.22s;
  min-width: 0;
}

.post-nav a:hover {
  border-color: var(--accent-border);
  background: var(--bg-panel-2);
}

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

.post-nav .dir {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--text-3);
  display: block;
  margin-bottom: 6px;
}

.post-nav .t {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text-1);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-nav .ghost {
  visibility: hidden;
}

/* ---------- 相关文章（文末 3 张卡片，JS 注入） ---------- */
.related {
  max-width: 720px;
  margin-top: 56px;
  padding-top: 34px;
  border-top: 1px solid var(--border);
}
.related-head {
  margin-bottom: 18px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  text-decoration: none;
  color: inherit;
  /* hover 反馈：transform / border / background 全部 0.25s */
  transition: transform 0.25s var(--ease-out), border-color 0.25s, background 0.25s;
  min-height: 138px;
}
/* 进场动画（reveal 0.8s）必须用更长 transition，否则会被基础规则覆盖成 0.25s 瞬变 */
.js .related-card.reveal {
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), filter 0.8s var(--ease-out),
              border-color 0.25s, background 0.25s;
}
.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  background: var(--bg-panel-2);
}
.related-card .date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.related-card h3 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 auto;
  letter-spacing: -0.005em;
}
.related-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.related-card .tag-row .t {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-2);
  letter-spacing: 0.02em;
}
.related-empty {
  color: var(--text-3);
  font-size: 13.5px;
  font-family: var(--font-mono);
}
@media (max-width: 900px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ---------- 阅读进度条（仅文章页，JS 注入到 body 末尾） ---------- */
.reading-progress {
  position: fixed;
  top: 64px;            /* 紧贴 .nav 底部（nav 高 64px） */
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 99;          /* 略低于 .nav(100)，不挡玻璃底 */
  pointer-events: none;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .reading-progress { transition: transform 0.08s linear; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .hero-visual {
    order: -1;
  }

  #orbit-canvas {
    width: min(72vw, 380px);
  }

  .hero {
    padding: 138px 0 84px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 68px 0;
  }

  .concept-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 22px;
  }

  .post-card .meta-col {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav a.next {
    text-align: left;
  }

  .brand-sub {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 18px;
  }

  /* 移动端紧凑 brand：只留 logo，文字彻底去掉，节省 ~70px 给 nav 链接和按钮 */
  .brand img {
    width: 28px;
    height: 28px;
  }
  .brand > span {
    display: none;
  }
  .brand {
    padding: 6px 6px;
    margin: -6px -6px;
  }

  /* 导航只显示 文章 + 项目 文字链接（去联系、去 GitHub），其余 nav-links 子元素隐藏 */
  .nav-links {
    gap: 2px;
  }
  .nav-links a {
    padding: 8px 12px;
    font-size: 13.5px;
  }
  /* "联系" 隐藏：精确属性选择，跨 archive/projects/articles 一致 */
  .nav-links a[href*="#contact"] {
    display: none;
  }
  /* GitHub 入口（.nav-cta）整条隐藏 */
  .nav-links > a.nav-cta,
  .nav-links > .nav-cta {
    display: none;
  }

  /* nav 总宽不超屏外：brand 占 40px，nav-links 占剩余空间，theme-toggle 44px，nav-search 44px */
  .brand {
    flex-shrink: 0;
  }
  .nav-links {
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
  }
  .nav-search {
    flex-shrink: 0;
    margin-left: 2px;
  }

  /* nav-search 展开：把 nav-links 折叠让位 */
  .nav-search { margin-left: 2px; }
  .nav-links.nav-search-open > a:not(.nav-search) {
    opacity: 0;
    pointer-events: none;
    transform: scaleX(0);
    width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
  .nav-search.open { width: calc(100vw - 18px - 40px); }
  .nav-search.open .nav-search-input { width: 100%; }
  .nav-search-results { width: calc(100vw - 36px); right: 18px; }

  /* 窄屏 placeholder 用更短字号避免截断 */
  .nav-search.open .nav-search-input {
    font-size: 13px;
    padding-left: 34px;
  }

  .hero-cta .btn {
    flex: 1;
    justify-content: center;
  }

  .footer-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* ---------- 跨页面过渡（View Transitions 跨文档） ---------- */
/* 浏览器原生的页面间过渡：仅同源 GET 导航生效，不支持的浏览器（如 Firefox）自动回退普通跳转 */
@view-transition {
  navigation: auto;
}

/* 页面整体：旧页下沉淡出，新页上浮淡入（html.theme-anim 期间让位给主题圆形扩散） */
html:not(.theme-anim)::view-transition-old(root) {
  animation: vt-page-out 0.18s ease-in both;
}

html:not(.theme-anim)::view-transition-new(root) {
  animation: vt-page-in 0.3s ease-out both;
}

/* 共享元素：文章卡片 / 侧栏目录项 → 文章页标题区。
   文章页这边常驻标记（侧栏项起飞时经 html.side-morph 让位，避免同页重名跳过过渡）；
   首页/归档的卡片、侧栏项由 JS 在点击时挂同名标记（见 main.js） */
html:not(.theme-anim):not(.side-morph) header.article-head {
  view-transition-name: post-hero;
}

/* 卡片变形比整页淡入淡出稍长一点，观感更从容 */
html:not(.theme-anim)::view-transition-group(post-hero) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.22, 0.9, 0.3, 1);
}

html:not(.theme-anim)::view-transition-old(post-hero),
html:not(.theme-anim)::view-transition-new(post-hero) {
  animation-duration: 0.32s;
}

@keyframes vt-page-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes vt-page-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* 方向性滑动：查看全部文章/项目 = 下钻（旧页向左滑走、新页自右滑入）；
   从列表页返回 = 上钻（反向）。跨文档过渡的动画规则以新页面的类为准
   （旧页只贡献快照，方向由 JS 经 sessionStorage 传给新页面挂类） */
html.nav-deep:not(.theme-anim)::view-transition-old(root) {
  animation: vt-slide-out-left 0.22s ease-in both;
}

html.nav-deep:not(.theme-anim)::view-transition-new(root) {
  animation: vt-slide-in-right 0.3s ease-out both;
}

html.nav-back:not(.theme-anim)::view-transition-old(root) {
  animation: vt-slide-out-right 0.22s ease-in both;
}

html.nav-back:not(.theme-anim)::view-transition-new(root) {
  animation: vt-slide-in-left 0.3s ease-out both;
}

@keyframes vt-slide-out-left {
  to {
    opacity: 0;
    transform: translateX(-48px);
  }
}

@keyframes vt-slide-in-right {
  from {
    opacity: 0;
    transform: translateX(64px);
  }
}

@keyframes vt-slide-out-right {
  to {
    opacity: 0;
    transform: translateX(48px);
  }
}

@keyframes vt-slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-64px);
  }
}

/* 减弱动态效果：页面过渡直接到最终状态（主题切换在 JS 里本来就会跳过） */
@media (prefers-reduced-motion: reduce) {
  html:not(.theme-anim)::view-transition-group(*),
  html:not(.theme-anim)::view-transition-old(*),
  html:not(.theme-anim)::view-transition-new(*) {
    animation-duration: 0.01s !important;
    animation-delay: 0s !important;
  }
}
