/* ============================================================
   饼B记 · 设计系统
   暖纸色调 / 明暗双模式 / 响应式
   ============================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* 纸感暖色基调 */
  --paper:        #faf7f2;
  --paper-2:      #f3eee5;
  --card:         #fffdfa;
  --card-2:       #faf6ef;

  --ink:          #221c17;
  --ink-2:        #4a4038;
  --ink-3:        #7d7268;
  --ink-4:        #a89c90;

  --line:         #e6ddcf;
  --line-2:       #d9cdb9;

  /* 主色：烘焙麦褐 */
  --brand:        #b5763a;
  --brand-deep:   #8f5a28;
  --brand-soft:   #f0dcc2;
  --brand-wash:   #fdf5ea;

  /* 功能色 */
  --accent:       #3f7d6e;
  --accent-soft:  #dcebe6;
  --danger:       #b4453a;
  --danger-soft:  #f8e2df;
  --warn:         #b5842a;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 26px;

  --shadow-1: 0 1px 2px rgba(60, 42, 26, .06), 0 2px 8px rgba(60, 42, 26, .04);
  --shadow-2: 0 2px 6px rgba(60, 42, 26, .08), 0 12px 28px rgba(60, 42, 26, .07);
  --shadow-3: 0 8px 20px rgba(60, 42, 26, .12), 0 30px 60px rgba(60, 42, 26, .10);

  --font-serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
                "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Roboto, sans-serif;
  --font-mono:  "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --maxw: 720px;
  --maxw-wide: 1120px;
  --header-h: 62px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

[data-theme="dark"] {
  --paper:        #16130f;
  --paper-2:      #1d1915;
  --card:         #221d18;
  --card-2:       #29231d;

  --ink:          #f2ece3;
  --ink-2:        #d3c9bc;
  --ink-3:        #9e9385;
  --ink-4:        #776c60;

  --line:         #342c24;
  --line-2:       #453b31;

  --brand:        #d79a5c;
  --brand-deep:   #e8b47c;
  --brand-soft:   #3b2c1c;
  --brand-wash:   #241b12;

  --accent:       #6fb3a1;
  --accent-soft:  #23352f;
  --danger:       #e08579;
  --danger-soft:  #3a2320;
  --warn:         #d6ac5c;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .2);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 12px 28px rgba(0, 0, 0, .28);
  --shadow-3: 0 8px 20px rgba(0, 0, 0, .45), 0 30px 60px rgba(0, 0, 0, .38);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

/* 纸纹质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(181, 118, 58, .05), transparent 45%),
    radial-gradient(circle at 84% 8%, rgba(63, 125, 110, .04), transparent 40%);
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: var(--brand-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

::selection { background: var(--brand-soft); color: var(--ink); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

.wrap { width: 100%; max-width: var(--maxw-wide); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--maxw); }

main { flex: 1 0 auto; padding-bottom: 80px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  height: 100%;
  display: flex; align-items: center; gap: 20px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
  color: var(--ink); letter-spacing: .02em;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff; font-size: 16px;
  box-shadow: var(--shadow-1);
}

.nav { display: flex; align-items: center; gap: 2px; margin-left: 4px; }
.nav a {
  padding: 7px 13px; border-radius: 99px;
  font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease);
  white-space: nowrap;
  display: inline-flex; align-items: center;
  min-height: 34px;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-deep); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px;
  border: 1px solid var(--line-2);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
}
.btn:hover { border-color: var(--ink-4); color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  border-color: transparent; color: #fff;
  box-shadow: var(--shadow-1);
}
.btn-primary:hover { color: #fff; box-shadow: var(--shadow-2); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-ghost:hover { background: var(--paper-2); border-color: transparent; }

.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, transparent); background: var(--danger-soft); }

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: 50%; }

/* ---------- Cards / Surfaces ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- Hero ---------- */
.hero { padding: 68px 0 40px; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 99px;
  background: var(--brand-wash); border: 1px solid var(--brand-soft);
  color: var(--brand-deep); font-size: 13px; font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.18;
  margin-bottom: 18px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand), var(--brand-deep));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  max-width: 560px; margin: 0 auto;
  color: var(--ink-3); font-size: 16.5px; line-height: 1.85;
}
.hero-stats {
  display: flex; justify-content: center; gap: 34px;
  margin-top: 30px; flex-wrap: wrap;
}
.hero-stat b { display: block; font-family: var(--font-serif); font-size: 26px; color: var(--brand-deep); }
.hero-stat span { font-size: 13px; color: var(--ink-4); }

/* ---------- Section heading ---------- */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin: 44px 0 20px; flex-wrap: wrap;
}
.sec-head h2 {
  font-family: var(--font-serif); font-size: 25px;
  display: flex; align-items: center; gap: 10px;
}
.sec-head h2::before {
  content: ""; width: 4px; height: 22px; border-radius: 99px;
  background: linear-gradient(var(--brand), var(--brand-deep));
}
.sec-head .sub { color: var(--ink-4); font-size: 14px; }

/* ---------- Post card ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 22px;
}

.post-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .24s var(--ease), box-shadow .24s var(--ease), border-color .24s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: var(--line-2);
}
.post-card:hover .post-card-title { color: var(--brand-deep); }

.post-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--brand-soft), var(--paper-2));
  overflow: hidden;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.post-card:hover .post-cover img { transform: scale(1.05); }
.post-cover-none {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 34px;
  color: color-mix(in srgb, var(--brand-deep) 55%, transparent);
}
.post-cover-cat {
  position: absolute; left: 12px; top: 12px;
  padding: 4px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(6px);
  color: var(--brand-deep); font-size: 12px; font-weight: 700;
}
.post-cover-lock {
  position: absolute; right: 12px; top: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  backdrop-filter: blur(6px);
  font-size: 13px;
  box-shadow: var(--shadow-1);
}

.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card-title {
  font-family: var(--font-serif); font-size: 19px; line-height: 1.45;
  margin-bottom: 9px; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; transition: color .2s var(--ease);
}
.post-card-excerpt {
  color: var(--ink-3); font-size: 14px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.post-card-meta {
  margin-top: auto; padding-top: 13px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; color: var(--ink-4);
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--paper-2); border: 1px solid var(--line);
  color: var(--ink-3); font-size: 12.5px; font-weight: 600;
  transition: all .18s var(--ease); white-space: nowrap;
  /* 触摸目标不小于 34px，便于手指点按 */
  min-height: 34px;
}
.tag:hover { background: var(--brand-soft); border-color: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }
.tag.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag-count { font-size: 11px; opacity: .7; min-height: 18px; display: inline-flex; align-items: center; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tag { padding: 7px 16px; font-size: 14px; }

.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; align-items: center; }
.tag-bar .filter-label { font-size: 13.5px; color: var(--ink-4); margin-right: 4px; }

/* ---------- Post detail ---------- */
.post-header { padding: 44px 0 26px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--ink-4); margin-bottom: 20px;
}
.back-link:hover { color: var(--brand-deep); text-decoration: none; }

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4.6vw, 40px);
  line-height: 1.28;
  margin-bottom: 16px;
}
.post-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  color: var(--ink-4); font-size: 13.5px;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); opacity: .6; }

.post-cover-full {
  margin: 30px 0 6px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

/* ---------- Markdown body ---------- */
.md {
  font-size: 16.5px;
  line-height: 1.86;
  color: var(--ink-2);
  word-wrap: break-word;
}
.md > *:first-child { margin-top: 0; }
.md > *:last-child { margin-bottom: 0; }

.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
  font-family: var(--font-serif);
  color: var(--ink);
  margin: 2em 0 .7em;
  line-height: 1.35;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.md h1 { font-size: 1.75em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.md h2 { font-size: 1.42em; padding-bottom: .28em; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 1.2em; }
.md h4 { font-size: 1.05em; }
.md h5 { font-size: .95em; color: var(--ink-2); }
.md h6 { font-size: .88em; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }

.md p { margin: 0 0 1.15em; }

.md a {
  color: var(--brand-deep);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color .18s var(--ease);
}
.md a:hover { text-decoration-color: var(--brand); }

.md strong { color: var(--ink); font-weight: 700; }
.md em { font-style: italic; }
.md del { color: var(--ink-4); }

.md ul, .md ol { margin: 0 0 1.15em; padding-left: 1.6em; }
.md li { margin: .35em 0; }
.md li > ul, .md li > ol { margin: .35em 0; }
.md li::marker { color: var(--brand); }

.md ul.task-list { list-style: none; padding-left: .25em; }
.md li.task { display: flex; align-items: flex-start; gap: .55em; }
.md li.task input { margin-top: .5em; accent-color: var(--brand); flex-shrink: 0; }
.md li.task.done { color: var(--ink-4); text-decoration: line-through; }

.md blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--brand-soft);
  color: var(--ink-3);
  font-style: italic;
}
.md blockquote p:last-child { margin-bottom: 0; }

.md code {
  font-family: var(--font-mono);
  font-size: .87em;
  padding: .16em .42em;
  border-radius: 5px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--brand-deep);
  word-break: break-word;
}

.md pre {
  margin: 1.5em 0;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #1c1815;
  border: 1px solid var(--line-2);
  overflow-x: auto;
  box-shadow: var(--shadow-1);
  direction: ltr;
}
.md pre code {
  display: block;
  background: none; border: 0; padding: 0;
  color: #e8ddd0; font-size: 13.5px; line-height: 1.7;
  white-space: pre;
}
.md pre .code-lang {
  display: block; margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 11.5px;
  color: #9c8d7c; letter-spacing: .1em; text-transform: uppercase;
}

.md img {
  margin: 1.6em 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}

.md hr { margin: 2.4em 0; border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); }

.md table {
  width: 100%; margin: 1.6em 0;
  border-collapse: collapse;
  font-size: 14.5px;
  display: block; overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.md thead { background: var(--paper-2); }
.md th, .md td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.md th { font-weight: 700; color: var(--ink); white-space: nowrap; }
.md tbody tr:last-child td { border-bottom: 0; }
.md tbody tr:hover { background: var(--card-2); }

.md figure { margin: 1.6em 0; }
.md figcaption { margin-top: -8px; font-size: 13px; color: var(--ink-4); text-align: center; }

/* ---------- Markdown 图表（:::chart 生成的内联 SVG） ---------- */
.md-chart {
  margin: 1.9em 0;
  padding: 16px 14px 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.md-chart-title {
  margin: 0 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  letter-spacing: .01em;
}
.md-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-sans);
}

/* ---------- Markdown 提示框（:::note / :::tip / :::warn / :::danger） ---------- */
.md-callout {
  margin: 1.6em 0;
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid var(--ink-4);
  background: var(--paper-2);
  font-size: 14.5px;
  line-height: 1.72;
}
.md-callout > *:first-child { margin-top: 0; }
.md-callout > *:last-child { margin-bottom: 0; }
.md-callout ul, .md-callout ol { margin: .6em 0; }
.md-callout-note   { border-left-color: var(--accent); background: var(--accent-soft); }
.md-callout-tip    { border-left-color: var(--brand);  background: var(--brand-soft); }
.md-callout-warn   { border-left-color: var(--warn);   background: var(--brand-wash); }
.md-callout-danger { border-left-color: var(--danger); background: var(--danger-soft); }

/* ---------- Post footer / reactions ---------- */
.post-footer { margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line); }

.react-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 20px; border-radius: 99px;
  border: 1px solid var(--line-2); background: var(--card);
  cursor: pointer; font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  transition: all .2s var(--ease);
}
.like-btn:hover { border-color: var(--danger); color: var(--danger); transform: translateY(-2px); }
.like-btn.liked {
  background: var(--danger-soft); border-color: var(--danger); color: var(--danger);
}
.like-btn.liked .heart { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.42); } 100% { transform: scale(1); } }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.post-nav a {
  padding: 15px 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
  transition: all .2s var(--ease);
}
.post-nav a:hover { border-color: var(--brand-soft); background: var(--brand-wash); text-decoration: none; }
.post-nav .dir { font-size: 12px; color: var(--ink-4); margin-bottom: 5px; display: block; }
.post-nav .t { font-size: 14.5px; color: var(--ink); font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav .next { text-align: right; }

/* ---------- Comments ---------- */
.comments { margin-top: 46px; }
.comments-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.comments-head h3 { font-family: var(--font-serif); font-size: 20px; }

.comment-form { padding: 20px; margin-bottom: 26px; }
.comment-form .who {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px; font-size: 13.5px; color: var(--ink-3);
}
.comment-editor {
  width: 100%; min-height: 108px;
  padding: 13px 15px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--card-2); color: var(--ink);
  font-size: 14.5px; line-height: 1.7;
  resize: vertical;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.comment-editor:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
  background: var(--card);
}
.comment-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }

.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment {
  display: flex; gap: 13px;
  padding: 17px 19px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color .2s var(--ease);
}
.comment:hover { border-color: var(--line-2); }
.comment.reply { margin-left: 46px; background: var(--card-2); }

.avatar {
  flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand-soft), var(--paper-2));
  color: var(--brand-deep); font-weight: 700; font-size: 15px;
  border: 1px solid var(--line-2);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }

.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.comment-name { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.comment-badge {
  padding: 1px 8px; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 11px; font-weight: 700;
}
.comment-time { font-size: 12px; color: var(--ink-4); }
.comment-text { font-size: 14.8px; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 12px; margin-top: 8px; }
.comment-actions button {
  background: none; border: 0; padding: 0;
  font-size: 12.5px; color: var(--ink-4); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.comment-actions button:hover { color: var(--brand-deep); }
.comment-actions button.liked { color: var(--danger); }

.reply-box { margin-top: 12px; }
.reply-box textarea {
  width: 100%; min-height: 76px; padding: 10px 13px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink); font-size: 14px; resize: vertical;
}
.reply-box textarea:focus { outline: none; border-color: var(--brand); }
.reply-box .acts { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.field .hint { font-size: 12.5px; color: var(--ink-4); margin-top: 6px; }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--card); color: var(--ink);
  font-size: 14.5px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23a89c90' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}

.form-error {
  padding: 10px 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger); font-size: 13.5px;
}
.form-ok {
  padding: 10px 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent); font-size: 13.5px;
}

/* ---------- Auth page ---------- */
.auth-wrap { max-width: 420px; margin: 56px auto; }
.auth-card { padding: 34px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .logo {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 15px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff; font-size: 26px; box-shadow: var(--shadow-2);
}
.auth-head h1 { font-family: var(--font-serif); font-size: 24px; margin-bottom: 7px; }
.auth-head p { color: var(--ink-4); font-size: 14px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--paper-2); border-radius: 99px; margin-bottom: 24px; }
.tabs button {
  flex: 1; padding: 8px; border: 0; border-radius: 99px;
  background: transparent; color: var(--ink-3);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s var(--ease);
}
.tabs button.active { background: var(--card); color: var(--brand-deep); box-shadow: var(--shadow-1); }

.auth-switch { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--ink-4); }
.auth-switch button {
  background: none; border: 0; padding: 0;
  color: var(--brand-deep); font-weight: 600; cursor: pointer;
}
.auth-switch button:hover { text-decoration: underline; }

/* ---------- Editor ---------- */
.editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.editor-main textarea.md-input {
  width: 100%; min-height: 520px;
  padding: 18px 20px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font-family: var(--font-mono); font-size: 14px; line-height: 1.85;
  resize: vertical;
}
.editor-main textarea.md-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }

.editor-side { position: sticky; top: calc(var(--header-h) + 20px); }
.preview-pane {
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto;
  padding: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
}

.editor-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.tool-btn {
  padding: 5px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-3);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .16s var(--ease);
}
.tool-btn:hover { background: var(--paper-2); color: var(--ink); }
.tool-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.cover-preview {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius); overflow: hidden;
  border: 1px dashed var(--line-2); background: var(--paper-2);
  display: grid; place-items: center; color: var(--ink-4); font-size: 13px;
  margin-bottom: 12px;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }

.drop-zone {
  padding: 22px; text-align: center;
  border: 2px dashed var(--line-2); border-radius: var(--radius);
  background: var(--card-2); cursor: pointer;
  transition: all .2s var(--ease);
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--brand); background: var(--brand-wash); }
.drop-zone .ico { font-size: 24px; margin-bottom: 8px; }
.drop-zone .t { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.drop-zone .s { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

.attach-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.attach-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item .sz { font-size: 12px; color: var(--ink-4); flex-shrink: 0; }

.editor-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line);
}

/* ---------- About ---------- */
.about-hero {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  padding: 34px; margin-bottom: 30px;
  background: linear-gradient(140deg, var(--brand-wash), var(--card));
  border: 1px solid var(--brand-soft); border-radius: var(--radius-xl);
}
.about-avatar {
  width: 92px; height: 92px; border-radius: 26px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff; font-family: var(--font-serif); font-size: 36px;
  box-shadow: var(--shadow-2);
}
.about-hero h1 { font-family: var(--font-serif); font-size: 28px; margin-bottom: 8px; }
.about-hero .role { color: var(--brand-deep); font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.about-hero .bio { color: var(--ink-2); font-size: 15px; line-height: 1.85; flex: 1; min-width: 260px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.info-card { padding: 20px; }
.info-card h4 {
  font-size: 13px; color: var(--ink-4); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px;
}
.info-list { display: flex; flex-direction: column; gap: 9px; }
.info-list a, .info-list span {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; color: var(--ink-2);
}
.info-list a:hover { color: var(--brand-deep); }

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line); border-radius: 99px;
}
.tl-item { position: relative; padding-bottom: 24px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--brand);
}
.tl-item .when { font-size: 12.5px; color: var(--brand-deep); font-weight: 700; margin-bottom: 3px; }
.tl-item .what { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.tl-item .why { font-size: 13.5px; color: var(--ink-3); }

/* ---------- Settings / profile ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .lbl { font-size: 14.5px; font-weight: 600; }
.setting-row .desc { font-size: 12.5px; color: var(--ink-4); margin-top: 3px; }

.danger-zone { border-color: color-mix(in srgb, var(--danger) 26%, var(--line)); }
.danger-zone h4 { color: var(--danger); }

/* ---------- Empty / Loading ---------- */
.empty { text-align: center; padding: 70px 20px; }
.empty .ico { font-size: 46px; margin-bottom: 16px; opacity: .5; }
.empty h3 { font-family: var(--font-serif); font-size: 19px; margin-bottom: 8px; }
.empty p { color: var(--ink-4); font-size: 14.5px; margin-bottom: 20px; }

.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--card-2) 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner {
  width: 17px; height: 17px;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px;
  transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 10px;
  align-items: center; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 20px;
  background: var(--ink); color: var(--paper);
  border-radius: 99px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-3);
  animation: toast-in .3s var(--ease);
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--accent); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(34, 28, 23, .48);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px;
  animation: fade .2s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 520px;
  max-height: 86vh; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  padding: 28px;
  animation: modal-in .28s var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal h3 { font-family: var(--font-serif); font-size: 20px; margin-bottom: 18px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  padding: 30px 0;
  margin-top: auto;
}
.site-footer .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-4);
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a {
  color: var(--ink-3); font-size: 13px;
  /* 触摸设备下加大点击区 */
  display: inline-flex; align-items: center;
  padding: 6px 4px; min-height: 32px;
}
.footer-links a:hover { color: var(--brand-deep); }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed; top: var(--header-h); left: 0; z-index: 59;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-deep));
  transition: width .1s linear;
}

/* ---------- TOC ---------- */
.toc {
  position: fixed; left: calc(50% + var(--maxw) / 2 + 40px);
  top: calc(var(--header-h) + 60px);
  width: 200px; max-height: 60vh; overflow-y: auto;
  font-size: 13px;
}
.toc-title {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-4); margin-bottom: 11px;
}
.toc a {
  display: block; padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
  color: var(--ink-3); line-height: 1.5;
  transition: all .18s var(--ease);
}
.toc a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--ink-4); }
.toc a.lvl-3 { padding-left: 24px; font-size: 12.5px; }
.toc a.active { color: var(--brand-deep); border-left-color: var(--brand); font-weight: 600; }

/* ---------- 阅读权限：锁定遮罩 ---------- */

.vis-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
}
.vis-badge.members {
  background: var(--brand-wash); color: var(--brand-deep);
  border: 1px solid var(--brand-soft);
}
.vis-badge.private {
  background: var(--paper-2); color: var(--ink-3);
  border: 1px solid var(--line-2);
}

.locked {
  position: relative;
  margin: 1.2em 0 0;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

/* 背景：模拟文本行的占位条，不含任何真实内容 */
.locked-fade {
  position: absolute; inset: 0;
  pointer-events: none;
  user-select: none;
  padding: 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.locked-line {
  height: 13px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--line), var(--paper-2), var(--line));
  opacity: .55;
  animation: lockedShimmer 2.6s ease-in-out infinite;
}
.locked-line.short { width: 62%; }
.locked-line:nth-child(2n) { animation-delay: .3s; }
.locked-line:nth-child(3n) { animation-delay: .6s; }
@keyframes lockedShimmer {
  0%, 100% { opacity: .35; }
  50% { opacity: .62; }
}

.locked-card {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 40px));
  margin: 90px auto 0;
  padding: 32px 28px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  animation: lockedIn .34s var(--ease);
}
@keyframes lockedIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.locked-ico { font-size: 34px; margin-bottom: 12px; }
.locked-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  margin-bottom: 10px;
}
.lock-tip {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.75;
  margin-bottom: 18px;
}
.lock-acts { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.locked-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--ink-4);
}

.locked-comments { opacity: .82; }

/* 访客评论徽标 */
.comment-badge.guest {
  background: var(--paper-2);
  color: var(--ink-4);
  border: 1px solid var(--line);
  font-weight: 500;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) { .toc { display: none; } }

@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
  .preview-pane { max-height: 560px; position: static; }
}

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .nav.mobile-open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    padding: 10px; gap: 2px; box-shadow: var(--shadow-2);
  }
  .hero { padding: 44px 0 28px; }
  .hero-stats { gap: 22px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .comment.reply { margin-left: 22px; }
  .panel { padding: 20px; }
  .auth-card { padding: 24px; }
  .about-hero { padding: 24px; gap: 18px; }
  .about-avatar { width: 68px; height: 68px; font-size: 27px; border-radius: 20px; }
  .post-meta { font-size: 12.5px; }
}

@media (max-width: 420px) {
  .hero-stat b { font-size: 22px; }
  .post-card-title { font-size: 17.5px; }
}

/* ---------- Print ---------- */
/* ============================================================
   微信分享
   ============================================================ */

/* 按钮：微信绿 + 官方双气泡图标 */
.wx-share-btn {
  background: #07c160;
  border-color: #07c160;
  color: #fff;
  font-weight: 600;
}
.wx-share-btn:hover {
  background: #06ad56;
  border-color: #06ad56;
  color: #fff;
  box-shadow: 0 2px 8px rgba(7, 193, 96, .3);
}
.wx-share-btn:disabled {
  background: #07c160;
  border-color: #07c160;
  opacity: .6;
  cursor: wait;
}

.wx-share-ico {
  width: 16px; height: 16px;
  display: inline-block;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.7 3C4.9 3 2 5.6 2 8.9c0 1.9 1 3.6 2.6 4.7l-.7 2.1 2.4-1.2c.8.2 1.6.4 2.4.4h.5a5 5 0 0 1-.1-1c0-3 2.8-5.4 6.2-5.4h.6C15.6 5.3 12.5 3 8.7 3zm-2.8 2.5a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8zm5.6 0a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8z'/%3E%3Cpath d='M22 14.4c0-2.7-2.5-4.9-5.5-4.9S11 11.7 11 14.4s2.5 4.9 5.5 4.9c.7 0 1.4-.1 2-.3l2 1-.5-1.7c1.2-.9 2-2.2 2-3.9zm-7.8-1.6a.8.8 0 1 1 0 1.6.8.8 0 0 1 0-1.6zm4.6 0a.8.8 0 1 1 0 1.6.8.8 0 0 1 0-1.6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.7 3C4.9 3 2 5.6 2 8.9c0 1.9 1 3.6 2.6 4.7l-.7 2.1 2.4-1.2c.8.2 1.6.4 2.4.4h.5a5 5 0 0 1-.1-1c0-3 2.8-5.4 6.2-5.4h.6C15.6 5.3 12.5 3 8.7 3zm-2.8 2.5a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8zm5.6 0a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8z'/%3E%3Cpath d='M22 14.4c0-2.7-2.5-4.9-5.5-4.9S11 11.7 11 14.4s2.5 4.9 5.5 4.9c.7 0 1.4-.1 2-.3l2 1-.5-1.7c1.2-.9 2-2.2 2-3.9zm-7.8-1.6a.8.8 0 1 1 0 1.6.8.8 0 0 1 0-1.6zm4.6 0a.8.8 0 1 1 0 1.6.8.8 0 0 1 0-1.6z'/%3E%3C/svg%3E");
}

/* 分享链接面板 */
.wxshare-mask {
  position: fixed; inset: 0; z-index: 215;
  background: rgba(34, 28, 23, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wxFade .2s var(--ease);
}

.wxshare-card {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 216;
  width: min(400px, calc(100% - 40px));
  padding: 24px 22px 20px;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  animation: wxPop .28s var(--ease);
}

.wxshare-head {
  display: flex; align-items: center; gap: 13px;
  padding-bottom: 18px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.wxshare-ico {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #07c160;
  color: #fff;
}
.wxshare-title {
  font-family: var(--font-serif);
  font-size: 17px; font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.wxshare-sub { font-size: 12.5px; color: var(--ink-4); line-height: 1.5; }

.wxshare-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--card-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  -webkit-user-select: text;
  user-select: text;
}
.wxshare-input:focus { outline: none; border-color: #07c160; }

.wxshare-acts {
  display: flex; gap: 10px;
  margin-top: 16px;
}
.wxshare-acts .btn { flex: 1; }
.wxshare-copy { background: #07c160; border-color: #07c160; color: #fff; }
.wxshare-copy:hover { background: #06ad56; border-color: #06ad56; color: #fff; }

.wxshare-foot {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-4);
  line-height: 1.6; text-align: center;
}

/* --- 微信内置浏览器适配 */

/* --- 分享引导浮层 --- */
.wx-guide-mask, .wx-copy-mask {
  position: fixed; inset: 0;
  background: rgba(34, 28, 23, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wxFade .2s var(--ease);
}
@keyframes wxFade { from { opacity: 0; } to { opacity: 1; } }

.wx-guide-card, .wx-copy-card {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 210;
  width: min(320px, calc(100% - 60px));
  padding: 26px 24px 22px;
  text-align: center;
  background: var(--card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-3);
  animation: wxPop .28s var(--ease);
}
@keyframes wxPop {
  from { opacity: 0; transform: translate(-50%, -46%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.wx-guide-arrow { margin-bottom: 10px; display: flex; justify-content: center; }
.wx-guide-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}
.wx-guide-desc {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-3);
  margin-bottom: 18px;
}
.wx-guide-btn { min-width: 100px; }

/* --- 手动复制降级 --- */
.wx-copy-url {
  padding: 11px 13px;
  margin-bottom: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  word-break: break-all;
  line-height: 1.6;
  -webkit-user-select: text;
  user-select: text;
}
.wx-copy-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.wx-copy-hint {
  font-size: 12.5px;
  color: var(--ink-4);
  margin-bottom: 16px;
}

/* --- 图片预览灯箱 --- */
.wx-lightbox {
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: center;
  background: rgba(10, 8, 6, .93);
  animation: wxFade .2s var(--ease);
  cursor: zoom-out;
}
.wx-lightbox img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
}

/* --- X5 内核兜底：sticky 支持不足时用 fixed --- */
@supports not (position: sticky) {
  .site-header { position: fixed; top: 0; left: 0; right: 0; width: 100%; }
  body { padding-top: var(--header-h); }
  .progress { top: var(--header-h); }
}

/* --- 移动端体验优化 */

/* 刘海屏 / 底部横条安全区适配（配合 viewport-fit=cover） */
@supports (padding: max(0px)) {
  .site-header .wrap { padding-left: max(24px, env(safe-area-inset-left)); }
  .wrap { padding-left: max(16px, env(safe-area-inset-left));
          padding-right: max(16px, env(safe-area-inset-right)); }
  .site-footer { padding-bottom: env(safe-area-inset-bottom); }
  .toast-wrap { bottom: calc(34px + env(safe-area-inset-bottom)); }
}

/* 触摸设备：去掉点击高亮方块，滚动更干净 */
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  /* 触摸设备给可点元素加按压反馈 */
  .btn:active, .nav a:active, .post-card:active { transform: scale(.98); }
  .post-card:active { box-shadow: var(--shadow-1); }
}

/* 触摸设备禁止长按弹出的系统菜单（除输入框外） */
@media (hover: none) {
  body { -webkit-touch-callout: none; }
  input, textarea { -webkit-touch-callout: default; }
}

/* iOS 输入框字号 ≥16px 可避免聚焦时页面自动放大 */
@media (max-width: 900px) {
  .input, .textarea, .select, .comment-editor, .md textarea {
    font-size: 16px !important;
  }
}

/* 移动端正文行高与字距略微放宽，提升可读性 */
@media (max-width: 760px) {
  .md { font-size: 16.5px; line-height: 1.9; }
  .post-title { line-height: 1.35; }
  /* 移动端让正文图片可点击放大 */
  .md img { border-radius: var(--radius-sm); }
}

@media print {
  .site-header, .site-footer, .comments, .post-footer, .react-bar, .toc, .progress, .toast-wrap { display: none !important; }
  body { background: #fff; }
  .post-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}