/* ============================================================
   二等饼干 · 跨境指南 — 设计系统
   编辑排版风：纸白底 / 朱砂 accent / 衬线标题 / 双语小标签
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #faf9f5;
  --bg-soft: #f3f1e9;
  --surface: #ffffff;
  --ink: #1c1b17;
  --ink-2: #57544a;
  --ink-3: #8f8b7c;
  --line: #e5e1d3;
  --line-strong: #d4cfbc;
  --accent: #b8432c;
  --accent-deep: #8f3120;
  --accent-soft: #f6e8e2;
  --shadow: 0 1px 2px rgb(28 27 23 / 0.04), 0 8px 24px rgb(28 27 23 / 0.06);
  --shadow-hover: 0 2px 4px rgb(28 27 23 / 0.06), 0 14px 36px rgb(28 27 23 / 0.1);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  --container: 72rem;
  --radius: 8px;
  --header-h: 3.75rem;
}

[data-theme="dark"] {
  --bg: #171713;
  --bg-soft: #1e1d18;
  --surface: #221f19;
  --ink: #ece8dc;
  --ink-2: #b4ae9f;
  --ink-3: #7f7a6b;
  --line: #322f26;
  --line-strong: #454238;
  --accent: #e0654b;
  --accent-deep: #f07c62;
  --accent-soft: #2c1e18;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 8px 24px rgb(0 0 0 / 0.3);
  --shadow-hover: 0 2px 4px rgb(0 0 0 / 0.25), 0 14px 36px rgb(0 0 0 / 0.4);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.container {
  width: min(var(--container), 100% - 3rem);
  margin-inline: auto;
}

@media (max-width: 40rem) {
  .container { width: min(var(--container), 100% - 2.25rem); }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 4px;
  font-size: 0.875rem;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0.75rem; }

/* ---------- 双语小标签 ---------- */
.section-label {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.section-label .label-cn {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.section-label .label-en {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
  line-height: 1.3;
}
.section-head .more-link {
  font-size: 0.9rem;
  color: var(--accent);
  white-space: nowrap;
}
.section-head .more-link:hover { color: var(--accent-deep); }
.section-head .more-link::after { content: " →"; }

/* ---------- 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-left: 0.15rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.site-nav a.nav-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  border-radius: 6px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.site-nav a.nav-link:hover { color: var(--ink); background: var(--bg-soft); }
.site-nav a.nav-link[aria-current="page"] { color: var(--accent); font-weight: 600; }

.nav-btn {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  color: var(--ink-2);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: var(--bg-soft); color: var(--ink); }
.nav-btn svg { width: 1.1rem; height: 1.1rem; }

.nav-toggle { display: none; }

@media (max-width: 46rem) {
  .site-nav .nav-link { display: none; }
  .nav-toggle { display: grid; }
  .site-nav.is-open {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1rem;
  }
  .site-nav.is-open .nav-link {
    display: block;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .site-nav.is-open .nav-link:last-of-type { border-bottom: 0; }
}

/* 主题切换图标 */
.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--line-strong) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 60% at 20% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 20% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.hero-eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--accent); }
.hero-title {
  margin: 0 0 1.4rem;
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.01em;
  max-width: 22em;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero-sub {
  margin: 0 0 2rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--ink-2);
  max-width: 34em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1.4rem;
  border-radius: 6px;
  font-size: 0.98rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-meta {
  margin-top: 2.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.hero-meta b { color: var(--accent); font-weight: 600; }

/* ---------- 首页区块 ---------- */
.home-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }

/* ---------- 编号分类卡 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
  gap: 1rem;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.4rem 1.35rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.cat-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
.cat-name {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.3;
}
.cat-keys { font-size: 0.84rem; color: var(--ink-3); line-height: 1.6; }
.cat-count {
  margin-top: auto;
  padding-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}
.cat-count b { color: var(--ink); font-weight: 600; }

/* ---------- 精选文章卡 ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: 1.5rem;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}
.post-card .cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .cover img { transform: scale(1.03); }
.post-card .body { display: flex; flex-direction: column; gap: 0.55rem; padding: 1.15rem 1.25rem 1.25rem; flex: 1; }
.post-card .title {
  font-family: var(--font-serif);
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card:hover .title { color: var(--accent); }
.post-card .excerpt {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 元信息 ---------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.meta-row .dot::before { content: "·"; margin-right: 0.75rem; color: var(--line-strong); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.16rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.76rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip-cat { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.reading-time { font-family: var(--font-mono); font-size: 0.74rem; }

/* ---------- 指南列表页 ---------- */
.page-head { padding: clamp(2.5rem, 5vw, 3.75rem) 0 1.75rem; }
.page-head .section-label { margin-bottom: 1rem; }
.page-head h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}
.page-head .lede { margin: 0; color: var(--ink-2); max-width: 36em; }

.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.9rem 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box svg { width: 1.05rem; height: 1.05rem; color: var(--ink-3); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-3); }
.search-box kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink-3);
  background: var(--bg-soft);
}
.search-clear { display: none; color: var(--ink-3); font-size: 0.85rem; padding: 0.2rem 0.4rem; border-radius: 4px; }
.search-clear:hover { color: var(--ink); background: var(--bg-soft); }
.search-box.has-text .search-clear { display: block; }
.search-box.has-text kbd { display: none; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink-2);
  background: var(--surface);
  transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.filter-chip .n { font-family: var(--font-mono); font-size: 0.72rem; opacity: 0.75; }

.result-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.result-count { font-size: 0.88rem; color: var(--ink-3); }
.result-count b { color: var(--ink); }
.result-reset { font-size: 0.85rem; color: var(--accent); }
.result-reset:hover { color: var(--accent-deep); }

.guide-list { display: flex; flex-direction: column; gap: 1rem; padding-bottom: 4rem; }
.guide-row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 1.4rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.guide-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}
.guide-row.is-hidden { display: none; }
.guide-row .thumb {
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
}
.guide-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.guide-row .info { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.guide-row .title {
  font-family: var(--font-serif);
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.45;
}
.guide-row:hover .title { color: var(--accent); }
.guide-row .excerpt { font-size: 0.92rem; color: var(--ink-2); line-height: 1.75; }

@media (max-width: 46rem) {
  .guide-row { grid-template-columns: 1fr; gap: 1rem; }
  .guide-row .thumb { aspect-ratio: 16 / 9; }
}

.empty-state {
  display: none;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-3);
}
.empty-state.is-visible { display: block; }
.empty-state .glyph { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { margin: 0 0 1.2rem; }

/* ---------- 文章页 ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.1s linear;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14rem;
  gap: 3.5rem;
  align-items: start;
  padding-top: clamp(2rem, 4vw, 3.25rem);
}
@media (max-width: 64rem) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc-rail { display: none; }
}

.article-head { max-width: 46rem; }
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-bottom: 1.4rem;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--line-strong); }
.breadcrumb [aria-current="page"] { color: var(--ink-2); }

.article-title {
  margin: 0.9rem 0 1.1rem;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.32;
}
.article-lead {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.95;
  color: var(--ink-2);
  margin: 0 0 2rem;
}
.article-cover {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  background: var(--bg-soft);
}
.article-cover img { width: 100%; }

.article-body { max-width: 46rem; font-size: 1.0625rem; }
.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 2.75rem 0 1.1rem;
  padding-left: 0.9rem;
  border-left: 4px solid var(--accent);
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}
.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.1rem 0 0.8rem;
}
.article-body p { margin: 0 0 1.4rem; }
.article-body a:not(.btn) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
}
.article-body a:not(.btn):hover { text-decoration-color: var(--accent); }
.article-body strong { font-weight: 700; }
.article-body ul, .article-body ol { margin: 0 0 1.4rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.5rem; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-2);
  font-family: var(--font-serif);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr {
  border: 0;
  text-align: center;
  margin: 2.75rem 0;
  color: var(--ink-3);
}
.article-body hr::before { content: "· · ·"; letter-spacing: 1em; }
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.15em 0.42em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.article-body .table-wrap { overflow-x: auto; margin: 1.8rem 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.article-body th, .article-body td {
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.article-body th { background: var(--bg-soft); font-weight: 600; white-space: nowrap; }
.article-body tbody tr:hover { background: var(--bg-soft); }

.callout {
  display: flex;
  gap: 0.85rem;
  margin: 1.8rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.96rem;
}
.callout .callout-icon { flex: none; font-size: 1.05rem; line-height: 1.6; }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-left-color: #c98a1b; }
.callout-warn .callout-icon { color: #c98a1b; }
.callout-note { border-left-color: #3d7a8c; }
.callout-note .callout-icon { color: #3d7a8c; }

.step-list { counter-reset: step; list-style: none; padding-left: 0; }
.step-list > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.1rem;
}
.step-list > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  background: var(--accent-soft);
}

.article-footer { max-width: 46rem; margin-top: 3rem; }
.update-log {
  font-size: 0.9rem;
  color: var(--ink-2);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.2rem;
}
.update-log b { color: var(--ink); }
.update-log ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.article-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.article-actions .btn { padding: 0.5rem 1rem; font-size: 0.88rem; }

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 46rem;
  margin: 2.5rem 0 0;
}
.article-nav a {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.article-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.article-nav .dir { display: block; font-size: 0.78rem; color: var(--ink-3); margin-bottom: 0.35rem; }
.article-nav .t { font-family: var(--font-serif); font-weight: 700; line-height: 1.5; font-size: 0.98rem; }
.article-nav .next { text-align: right; }

@media (max-width: 40rem) { .article-nav { grid-template-columns: 1fr; } }

.related { max-width: 46rem; margin: 3.5rem 0 0; }
.related .section-label { margin-bottom: 1.25rem; }

/* ---------- 目录 ---------- */
.toc-rail {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
  font-size: 0.85rem;
}
.toc-rail .toc-title {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
}
.toc-rail nav { display: flex; flex-direction: column; gap: 0.1rem; border-left: 1px solid var(--line); }
.toc-rail a {
  padding: 0.28rem 0 0.28rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  line-height: 1.5;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc-rail a:hover { color: var(--ink); }
.toc-rail a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc-rail a[data-level="3"] { padding-left: 1.7rem; font-size: 0.82rem; }

.toc-mobile { margin-bottom: 2rem; }
.toc-mobile summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 0.6rem 0;
  list-style: none;
}
.toc-mobile summary::before { content: "目录 ▾ "; color: var(--accent); }
.toc-mobile[open] summary::before { content: "目录 ▴ "; }
.toc-mobile ol { margin: 0.5rem 0 0; padding-left: 1.3rem; font-size: 0.9rem; }
.toc-mobile li { margin-bottom: 0.3rem; }
.toc-mobile a { color: var(--ink-2); }
@media (min-width: 64.0625rem) { .toc-mobile { display: none; } }

/* ---------- 关于页 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 3rem;
  align-items: start;
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}
@media (max-width: 52rem) { .about-grid { grid-template-columns: 1fr; gap: 2rem; } }
.about-mark {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 6rem;
  font-weight: 700;
  overflow: hidden;
}
.about-mark::after {
  content: "";
  position: absolute;
  inset: 0.8rem;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 4px;
}
.about-mark small {
  position: absolute;
  bottom: 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.85;
}
.about-body h1 {
  margin: 0 0 1.4rem;
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.3;
}
.about-body .about-lede {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink-2);
  margin-bottom: 2rem;
}
.about-body h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin: 2.25rem 0 0.9rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--accent);
}
.principle-list { list-style: none; padding: 0; margin: 0; }
.principle-list li {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
}
.principle-list li:last-child { border-bottom: 0; }
.principle-list .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 0.3rem;
  flex: none;
}
.principle-list b { display: block; font-weight: 700; margin-bottom: 0.15rem; }
.principle-list span { font-size: 0.93rem; color: var(--ink-2); }

.contact-block {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact-block h2 { border: 0; padding: 0; margin: 0 0 1rem; }
.contact-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--ink-2);
  transition: all 0.15s ease;
}
.contact-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 404 ---------- */
.notfound {
  min-height: 68vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 3rem 0;
}
.notfound .code {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}
.notfound h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 1rem 0 0.75rem;
}
.notfound p { color: var(--ink-2); margin: 0 0 2rem; }
.notfound .hero-actions { justify-content: center; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.75rem 0 2.25rem;
  margin-top: 2rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.75rem;
}
.footer-brand { max-width: 22rem; }
.footer-brand .brand { margin-bottom: 0.6rem; }
.footer-brand p { margin: 0; font-size: 0.88rem; color: var(--ink-3); line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.9rem; }
.footer-links a { color: var(--ink-2); }
.footer-links a:hover { color: var(--accent); }
.footer-base {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--ink-3);
}

/* ---------- 动效 ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 40;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { border-color: var(--accent); color: var(--accent); }
