/* Pionus — Paper & Ink
 * Light-first reading theme with a dark companion.
 */

:root {
  color-scheme: light;
  --paper: #f7f4ed;
  --paper-raised: #fffdf8;
  --ink: #221f1b;
  --ink-soft: #3c372f;
  --muted: #726b5f;
  --faint: #9a9284;
  --line: #e2dbcd;
  --line-strong: #cfc5b4;
  --accent: #a63d2f;
  --accent-soft: #f3e4de;
  --accent-2: #2f6f4f;
  --accent-2-soft: #e4efe8;
  --code-bg: #20251f;
  --code-fg: #e9e4d8;
  --code-muted: #9aa694;
  --danger: #a32f2f;
  --shadow: 0 1px 2px rgba(34, 31, 27, .04), 0 12px 32px rgba(34, 31, 27, .05);
  --radius: 12px;
  --wrap: 1080px;
  --reading: 740px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #15171a;
  --paper-raised: #1b1e22;
  --ink: #e8e3d9;
  --ink-soft: #cfc8bb;
  --muted: #9b9588;
  --faint: #756f64;
  --line: #2b2e33;
  --line-strong: #3b3f45;
  --accent: #e08270;
  --accent-soft: #33231f;
  --accent-2: #7fbf9b;
  --accent-2-soft: #1a2a22;
  --code-bg: #0f1113;
  --code-fg: #e7e2d7;
  --code-muted: #8b938a;
  --danger: #e07a7a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(166, 61, 47, .045), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(47, 111, 79, .04), transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="dark"] body {
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(224, 130, 112, .05), transparent 60%),
    radial-gradient(800px 500px at 110% 0%, rgba(127, 191, 155, .04), transparent 55%),
    var(--paper);
}

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip {
  position: absolute; left: -9999px; top: 12px; z-index: 100;
  background: var(--paper-raised); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 20px; }

.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), #c9844f);
  z-index: 50; transition: width .1s linear;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 26px;
  min-height: 64px; padding-block: 10px;
}
.brand {
  font-family: var(--serif); font-size: 19px; font-weight: 700;
  letter-spacing: .01em; color: var(--ink); white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 6px 10px; border-radius: 7px; color: var(--muted);
  font-size: 14px; line-height: 1.4;
}
.nav a:hover { background: var(--paper-raised); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-raised); overflow: hidden; }
.search input {
  width: 128px; border: 0; background: transparent; padding: 7px 9px;
  font-size: 13px; outline: none;
}
.search input::placeholder { color: var(--faint); }
.search button { border: 0; background: transparent; color: var(--muted); padding: 5px 8px; cursor: pointer; }
.theme-toggle {
  width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-raised); color: var(--muted); cursor: pointer;
  display: grid; place-items: center; font-size: 15px;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--line-strong); }

main.wrap { flex: 1 0 auto; padding-block: 44px 72px; }

/* Home */
.intro { padding: 18px 0 44px; border-bottom: 1px solid var(--line); margin-bottom: 38px; }
.eyebrow {
  margin: 0 0 12px; color: var(--accent);
  font-family: var(--mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase;
}
.intro h1, .page-head h1 {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 56px);
  line-height: 1.15; letter-spacing: -.02em; margin: 0 0 14px; font-weight: 700;
}
.page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.lede { font-size: 18px; color: var(--ink-soft); max-width: 62ch; margin: 0 0 16px; }
.intro-links { color: var(--faint); font-size: 14px; display: flex; gap: 10px; align-items: center; }
.intro-links a { color: var(--accent); }

.section { margin-bottom: 44px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.section-head h2, .year {
  font-family: var(--serif); font-size: 21px; margin: 0; font-weight: 700;
}
.more { font-size: 13px; color: var(--muted); }
.more:hover { color: var(--accent); }

.post-list { border-top: 1px solid var(--line); }
.post-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr);
  gap: 18px; padding: 18px 10px; border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.post-row:hover { background: var(--paper-raised); text-decoration: none; }
.post-row time { color: var(--faint); font-family: var(--mono); font-size: 12px; padding-top: 5px; }
.post-row h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.45; font-weight: 650; }
.post-row:hover h3 { color: var(--accent); }
.post-row p {
  margin: 0 0 7px; color: var(--muted); font-size: 14px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-cats { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-cats span { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }

.home-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper-raised); color: var(--ink-soft); font-size: 13px;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chips small { color: var(--faint); font-family: var(--mono); font-size: 10px; }
.chips.tags a::before { content: "#"; color: var(--faint); }

/* Archive */
.page-head { margin-bottom: 30px; }
.page-head .muted { margin: 0; }
.muted { color: var(--muted); }
.year-group { margin-bottom: 34px; }
.year {
  display: flex; align-items: center; gap: 14px;
  color: var(--accent); font-size: 24px; margin-bottom: 8px;
}
.year::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.archive-list { border-top: 1px solid var(--line); }
.archive-row {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px; align-items: baseline;
  padding: 11px 8px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.archive-row:hover { background: var(--paper-raised); text-decoration: none; }
.archive-row time { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.archive-row:hover .archive-title { color: var(--accent); }
.archive-title { font-size: 15.5px; }
.archive-cat { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.empty-state, .empty { padding: 40px 0; color: var(--muted); }
.pager {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 16px; margin-top: 34px; font-size: 14px;
}
.pager a:last-child, .pager > :last-child { text-align: right; }
.pager-info { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* Taxonomy */
.taxonomy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tax-card {
  display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-raised); color: var(--ink); box-shadow: var(--shadow);
}
.tax-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.tax-card h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; }
.tax-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.tax-card span { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.tag-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud a {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper-raised);
  color: var(--ink-soft); font-size: 14px;
}
.tag-cloud a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tag-cloud small { font-family: var(--mono); font-size: 10px; color: var(--faint); }

/* Post */
.post-head { max-width: var(--reading); margin-bottom: 30px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cats a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em;
  color: var(--accent-2); padding: 3px 9px; background: var(--accent-2-soft);
  border-radius: 999px;
}
.cats a:hover { text-decoration: none; filter: brightness(.96); }
.post-head h1 {
  font-family: var(--serif); font-size: clamp(28px, 4.2vw, 44px);
  line-height: 1.25; letter-spacing: -.015em; margin: 0 0 16px; font-weight: 700;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0;
  color: var(--muted); font-size: 13px;
}
.post-meta span, .post-meta time { position: relative; }
.post-layout { display: grid; grid-template-columns: minmax(0, var(--reading)) 220px; gap: 48px; align-items: start; }
.post-layout.no-toc { grid-template-columns: minmax(0, var(--reading)); }
.post-body { min-width: 0; }
.toc {
  position: sticky; top: 92px; font-size: 13px;
  border-left: 1px solid var(--line); padding-left: 18px;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.toc summary {
  list-style: none; cursor: pointer; display: block;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 9px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: " ▾"; font-size: 10px; }
.toc details:not([open]) summary::after { content: " ▸"; }
.toc nav { display: flex; flex-direction: column; gap: 4px; }
.toc a { color: var(--muted); line-height: 1.45; padding: 2px 0; border-left: 2px solid transparent; margin-left: -20px; padding-left: 18px; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc-level-3 { padding-left: 32px !important; font-size: 12.5px; }
.toc-level-4 { padding-left: 46px !important; font-size: 12px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-tags a { font-size: 13px; color: var(--muted); }
.post-tags a:hover { color: var(--accent); }

.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line);
}
.post-nav a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised);
  color: var(--ink);
}
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav small { font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.post-nav span { font-size: 14px; line-height: 1.45; }
.post-nav .next { text-align: right; }

/* Prose */
.prose { font-size: 17px; line-height: 1.9; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); color: var(--ink); line-height: 1.35;
  margin: 2em 0 .7em; scroll-margin-top: 88px;
}
.prose h2 { font-size: 26px; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 21px; }
.prose h4 { font-size: 18px; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.prose strong { color: var(--ink); }
.prose blockquote {
  margin: 1.4em 0; padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent-2); color: var(--muted);
}
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.15em; }
.prose li { margin: .25em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose code {
  font-family: var(--mono); font-size: .86em;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: .15em .38em; border-radius: 5px;
  overflow-wrap: anywhere;
}
.prose pre {
  position: relative; margin: 1.5em 0; padding: 18px 20px;
  background: var(--code-bg); color: var(--code-fg);
  border-radius: 10px; overflow-x: auto; line-height: 1.62;
  font-size: 13.5px; tab-size: 4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.prose pre code {
  background: transparent; padding: 0; border-radius: 0; color: inherit;
  font-size: inherit; white-space: pre;
}
.prose pre code.hljs { background: transparent; padding: 0; }

.prose pre .copy {
  position: absolute; top: 8px; right: 8px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06);
  color: var(--code-fg); border-radius: 6px; padding: 3px 8px;
  font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.prose pre:hover .copy, .prose pre .copy:focus { opacity: 1; }
.prose img {
  display: block; max-width: 100%; height: auto; margin: 1.5em auto;
  border-radius: 8px; background: var(--paper-raised);
}
.prose .img-broken {
  display: block; padding: 22px; margin: 1.5em 0; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: 8px;
  color: var(--muted); font-size: 13px; background: var(--paper-raised);
}
.prose figure { margin: 1.5em 0; }
.prose figcaption { text-align: center; color: var(--faint); font-size: 12.5px; margin-top: 6px; }
.prose .table-wrap { overflow-x: auto; margin: 1.5em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--paper-raised); font-weight: 650; }
.prose iframe, .prose video { display: block; width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.prose mark { background: #f6e7a6; color: #3a3320; padding: 0 2px; }
[data-theme="dark"] .prose [style] { color: inherit !important; }
[data-theme="dark"] .prose mark { background: #4b4220; color: #f1e8c9; }

/* Comments */
.comments { max-width: var(--reading); margin-top: 56px; padding-top: 30px; border-top: 1px solid var(--line); }
.comments-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.comments-head h2 { font-family: var(--serif); font-size: 22px; margin: 0; }
.comment-list { display: flex; flex-direction: column; gap: 16px; }
.comment { display: flex; gap: 12px; }
.comment .comment { margin-top: 16px; }
.comment-main { min-width: 0; flex: 1; }
.avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--avatar, var(--accent-2));
  color: #fff; font-size: 13px; font-weight: 650; user-select: none;
}
.comment-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; font-size: 13px; }
.comment-meta strong { color: var(--ink); font-weight: 650; }
.comment-time { color: var(--faint); font-family: var(--mono); font-size: 11px; }
.comment-body { font-size: 14.5px; line-height: 1.75; color: var(--ink-soft); overflow-wrap: anywhere; }
.comment-body p { margin: 0 0 .6em; }
.comment-body a { text-decoration: underline; }
.comment-body img { max-width: 100%; }
.comment .children, .comment-main > .comment { margin-top: 14px; }
.comment.depth-1 { margin-left: 30px; }
.comment.depth-2 { margin-left: 24px; }
.comment.depth-3 { margin-left: 20px; }
.comment.depth-4, .comment.depth-5 { margin-left: 14px; }
.linkish { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.linkish:hover { color: var(--accent); text-decoration: underline; }
.reply { margin-top: 4px; }

.notice { padding: 10px 14px; border-radius: 8px; background: var(--accent-2-soft); color: var(--accent-2); font-size: 14px; }
.error { padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: 14px; }

.comment-form {
  margin-top: 28px; padding: 22px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper-raised); box-shadow: var(--shadow);
}
.comment-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.comment-form h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 14px; }
.form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comment-form label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.comment-form input, .comment-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
  color: var(--ink); font-size: 14px; outline: none;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.comment-form textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.comment-form-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.comment-form-foot button {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 7px; cursor: pointer; font-size: 14px;
}
.comment-form-foot button:hover { filter: brightness(1.06); }
.comment-form-foot .muted { font-size: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.reply-hint { font-size: 13px; color: var(--accent-2); }

/* Footer */
.site-footer { flex-shrink: 0; border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--faint); font-size: 12.5px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); }
.powered { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }

/* 404 */
.error-page { max-width: 640px; padding: 40px 0 60px; }
.error-page h1 { font-family: var(--serif); font-size: 44px; margin: 0 0 12px; }
.big-search { display: flex; gap: 10px; margin: 26px 0; }
.big-search input {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper-raised); outline: none;
}
.big-search input:focus { border-color: var(--accent); }
.big-search button { padding: 11px 20px; border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; cursor: pointer; }

/* Responsive */
@media (max-width: 1000px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; margin-top: 34px; max-height: none; }
  .toc a { margin-left: 0; padding-left: 0; border-left: 0; }
  .toc-level-3 { padding-left: 14px !important; }
  .toc-level-4 { padding-left: 28px !important; }
  .post-layout .toc { order: 2; margin: 26px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-raised); }
  .post-layout .toc details[open] nav { max-height: 45vh; overflow-y: auto; }
}
@media (max-width: 760px) {
  .wrap { width: min(var(--wrap), 100% - 28px); }
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; flex: 1 0 100%; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .search input { width: 100px; }
  main.wrap { padding-block: 30px 56px; }
  .intro { padding-bottom: 30px; }
  .home-columns { grid-template-columns: 1fr; gap: 30px; }
  .post-row { grid-template-columns: 1fr; gap: 4px; }
  .post-row time { padding-top: 0; }
  .archive-row { grid-template-columns: 46px minmax(0, 1fr); }
  .archive-cat { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .prose { font-size: 16.5px; }
  .footer-inner { justify-content: flex-start; }
}

@media print {
  .site-header, .site-footer, .toc, .comments, .progress, .theme-toggle, .search { display: none !important; }
  body { background: #fff; color: #000; }
  .post-layout { display: block; }
  .prose a { color: #000; text-decoration: underline; }
}

/* 微语 timeline */
.timeline {
  list-style: none; margin: 0; padding: 0;
  --timeline-date: 84px;
  --timeline-gap: 26px;
  --timeline-gap-y: 38px;
  max-width: calc(var(--reading) + 120px);
}
.timeline-item {
  display: grid;
  grid-template-columns: var(--timeline-date) 1px minmax(0, 1fr);
  column-gap: var(--timeline-gap);
  position: relative;
  padding-bottom: var(--timeline-gap-y);
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--timeline-date) + var(--timeline-gap) + 0.5px);
  width: 1px;
  background: var(--line);
}
.timeline-item:first-child::before { top: 22px; }
.timeline-item:last-child::before { bottom: calc(100% - 22px); }
.timeline-date {
  display: flex; flex-direction: column; align-items: flex-end; text-align: right;
  padding-top: 2px; color: var(--ink); text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.timeline-month {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
}
.timeline-day {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", var(--serif);
  font-style: italic; font-weight: 700; font-size: 46px; line-height: .92;
  letter-spacing: -.06em; color: var(--ink);
}
.timeline-day::after {
  content: ""; display: block; width: 38px; height: 1px;
  margin: 7px 0 0 auto; background: var(--line-strong);
}
.timeline-year {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--faint); margin-top: 4px;
}
.timeline-axis { position: relative; }
.timeline-dot {
  position: absolute; top: 22px; left: 50%; transform: translate(-50%, -50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--paper);
}
.timeline-content {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: 2px 10px 10px 2px;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}
.timeline-content:hover { border-color: var(--line-strong); border-left-color: var(--accent); }
.note-body { font-size: 15px; line-height: 1.8; color: var(--ink-soft); overflow-wrap: anywhere; }
.note-body p { margin: 0 0 .8em; }
.note-body p:last-child { margin-bottom: 0; }
.note-body a { color: var(--accent); text-decoration: underline; }
.note-body img { max-width: 100%; border-radius: 8px; }

/* 传送门 friend links */
.friend-links {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin: 24px 0 8px;
}
.friend-link {
  display: flex; flex-direction: row; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper-raised); color: var(--ink);
}
.friend-avatar-wrap {
  position: relative; flex: 0 0 42px; width: 42px; height: 42px;
  border-radius: 50%; overflow: hidden; background: var(--accent-2-soft);
}
.friend-avatar-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-size: 18px; line-height: 1;
  font-weight: 700; color: var(--accent-2);
}
.prose .friend-avatar {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; max-width: none; margin: 0;
  border-radius: 0; object-fit: cover; object-position: center;
  background: transparent;
}
.friend-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.friend-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.friend-link strong { font-size: 15px; }
.friend-text > span { font-family: var(--mono); font-size: 11px; color: var(--faint); }

@media (max-width: 760px) {
  .timeline { --timeline-date: 58px; --timeline-gap: 14px; --timeline-gap-y: 30px; max-width: none; }
  .timeline-day { font-size: 32px; }
  .timeline-day::after { width: 26px; margin-top: 5px; }
  .timeline-content { padding: 14px 15px; }
  .timeline-dot { top: 18px; }
  .friend-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 460px) {
  .timeline { --timeline-date: 48px; --timeline-gap: 11px; --timeline-gap-y: 26px; }
  .timeline-day { font-size: 28px; }
  .friend-links { grid-template-columns: 1fr; }
}

.note-permalink {
  display: inline-block; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
}
.note-permalink:hover { color: var(--accent); text-decoration: none; }

.post-lock { font-size: 12px; color: var(--faint); margin-left: 6px; }
.password-box {
  max-width: 420px; margin: 40px 0; padding: 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-raised); box-shadow: var(--shadow);
}
.password-box p { margin: 0 0 16px; color: var(--muted); }
.password-box label { display: block; font-size: 12px; color: var(--muted); }
.password-box input {
  display: block; width: 100%; margin: 5px 0 16px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--paper);
}
.password-box input:focus { border-color: var(--accent); outline: none; }
.password-box button {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 8px 16px; border-radius: 7px; cursor: pointer;
}

.preview-banner {
  max-width: var(--reading); margin: -10px 0 24px; padding: 10px 14px;
  border: 1px dashed var(--accent); border-radius: 8px;
  color: var(--accent); background: var(--accent-soft); font-size: 13px;
}
