/*
 * Zexi's Blog visual system
 *
 * Astro generates the page structure at build time. This file owns the blog's
 * tokens, layout, and responsive reading experience.
 */

:root {
  --blog-canvas: #fffdf9;
  --blog-surface: #fffaf5;
  --blog-ink: #24221f;
  --blog-muted: #716c65;
  --blog-faint: #a7a19a;
  --blog-line: #e9e2d9;
  --blog-accent: #d94d7a;
  --blog-accent-wash: #fce8ef;
  --blog-shadow: 0 16px 45px rgba(77, 58, 44, 0.08);
  --blog-content-width: 740px;
  --blog-reader-width: 1050px;
  --theme-color: var(--blog-accent);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--blog-canvas);
  color: var(--blog-ink);
}

body,
button,
input,
textarea {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

.markdown-section {
  max-width: var(--blog-content-width);
  padding: 64px 32px 72px;
  margin: 0 auto;
  color: var(--blog-ink);
  font-size: 17px;
  line-height: 1.9;
}

.markdown-section > :first-child { margin-top: 0; }

.markdown-section p,
.markdown-section ul,
.markdown-section ol { margin: 1em 0; }

.markdown-section ul,
.markdown-section ol { padding-left: 1.7em; }

.markdown-section a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-decoration-color: rgba(217, 77, 122, 0.3);
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.markdown-section a:hover {
  color: #ad315a;
  text-decoration-color: currentColor;
}

.markdown-section p,
.markdown-section li { letter-spacing: 0.012em; }

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  color: var(--blog-ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.markdown-section h1 {
  max-width: 22em;
  margin: 0 0 0.9em;
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.28;
}

.markdown-section h2 {
  margin: 2.6em 0 0.8em;
  padding: 0;
  border: 0;
  font-size: 1.5rem;
  line-height: 1.45;
}

.markdown-section h3 {
  margin: 2em 0 0.65em;
  font-size: 1.16rem;
  line-height: 1.55;
}

.markdown-section h4 {
  margin: 1.7em 0 0.55em;
  font-size: 1rem;
}

.markdown-section h1 .anchor,
.markdown-section h2 .anchor,
.markdown-section h3 .anchor,
.markdown-section h4 .anchor {
  color: inherit;
  text-decoration: none;
}

.markdown-section hr {
  height: 1px;
  margin: 3rem 0;
  border: 0;
  background: var(--blog-line);
}

.markdown-section blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1.1em;
  color: var(--blog-muted);
  border-left: 2px solid var(--blog-accent);
  font-size: 0.98em;
}

.markdown-section blockquote p { margin: 0.5em 0; }

.markdown-section mark {
  padding: 0.05em 0.14em;
  color: inherit;
  background: rgba(202, 164, 75, 0.16);
  border-radius: 0.18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.markdown-section code {
  color: #a5345c;
  background: #f8eee9;
  border-radius: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.markdown-section pre {
  margin: 1.8em 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--blog-line);
  border-radius: 0.7rem;
  box-shadow: none;
}

.markdown-section pre > code {
  color: inherit;
  background: transparent;
}

.markdown-section table {
  display: block;
  width: 100%;
  margin: 1.8em 0;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--blog-line);
  border-radius: 0.6rem;
}

.markdown-section th,
.markdown-section td {
  padding: 0.7em 0.8em;
  border-color: var(--blog-line);
}

.markdown-section th { background: var(--blog-surface); }

.markdown-section img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--blog-line);
  border-radius: 0.65rem;
  box-shadow: var(--blog-shadow);
}

.markdown-section .mermaid {
  margin: 1.8em 0;
  overflow-x: auto;
  text-align: center;
}

/* Article reader */
.article-page .blog-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--blog-content-width)) 210px;
  gap: 72px;
  align-items: start;
  max-width: var(--blog-reader-width);
  padding: 64px 32px 72px;
  margin: 0 auto;
}

.article-page .markdown-section {
  min-width: 0;
  padding: 0;
  margin: 0;
}

.article-page .markdown-section h1 { margin-bottom: 0.35rem; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 2.4rem;
  color: var(--blog-faint);
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.article-breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0 0 2rem;
  overflow: hidden;
  color: var(--blog-faint);
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.article-breadcrumb a {
  flex: none;
  color: var(--blog-muted);
  text-decoration: none;
}

.article-breadcrumb a:hover { color: var(--blog-accent); }

.article-breadcrumb__separator { color: var(--blog-line); }

.article-breadcrumb__current {
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-toc {
  position: sticky;
  top: 2.5rem;
  max-height: calc(100vh - 5rem);
  padding: 0.25rem 0 0.25rem 1.05rem;
  overflow: auto;
  border-left: 1px solid var(--blog-line);
  scrollbar-width: thin;
}

.article-toc__list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.article-toc__item + .article-toc__item { margin-top: 0.2rem; }

.article-toc__item--h3 { padding-left: 0.72rem; }

.article-toc__link {
  display: block;
  padding: 0.3rem 0;
  color: var(--blog-muted);
  font-size: 0.79rem;
  line-height: 1.45;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.article-toc__link:hover,
.article-toc__link.is-active {
  color: var(--blog-accent);
}

.article-toc__link.is-active { transform: translateX(2px); }

/* Home */
.home-page .markdown-section {
  max-width: 820px;
  min-height: calc(100vh - 152px);
  padding-top: clamp(64px, 12vh, 132px);
}

.home-page .markdown-section h1,
.home-page .markdown-section h2,
.home-page .markdown-section h3,
.home-page .markdown-section h4 { font-weight: 400; }

.home-page .markdown-section h1 a,
.home-page .markdown-section h2 a,
.home-page .markdown-section h3 a,
.home-page .markdown-section h4 a {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.home-page .markdown-section h1 {
  margin-bottom: 0.22em;
  font-size: clamp(2.65rem, 7vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.065em;
}

.profile-intro,.feed-section,.legacy-index,.resume { max-width: 820px; padding: 72px 32px 0; margin: 0 auto; }
.profile-intro { padding-top: 40px; }
.notes-title { margin: 0 0 1.25rem; font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 300; color: var(--blog-accent); letter-spacing: -0.045em; line-height: 1.15; }
.profile-links { align-items: center; }
.profile-links .profile-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; }
.profile-icon svg { width: 17px; height: 17px; fill: currentColor; }
.profile-links .profile-icon { color: var(--blog-muted); border-radius: 50%; transition: color 160ms ease; }
.profile-icon:focus-visible { outline: 1px solid var(--blog-accent); outline-offset: 2px; }
.profile-links .profile-icon:hover { color: var(--blog-accent); }
.profile-icon svg[fill="none"] { fill: none; }
.eyebrow { margin: 0 0 0.8rem; color: var(--blog-accent); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; }
.section-heading h1 { font-size: 1.4rem; font-weight: 500; }
.profile-lede { max-width: 34rem; margin: 2rem 0 1.5rem; color: var(--blog-muted); font-size: 1.2rem; line-height: 1.75; }
.profile-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: -9.5px; }
.profile-links a,.feed-item a { color: var(--blog-ink); text-decoration: none; border-bottom: 1px solid var(--blog-line); }
.profile-links a:hover,.feed-item a:hover { color: var(--blog-accent); border-color: var(--blog-accent); }
.feed-section { padding-top: 32px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; border-bottom: 1px solid var(--blog-line); }
.section-heading h2,.legacy-index h2 { margin: 0 0 0.7rem; font-size: 2rem; font-weight: 400; }
.feed-count,.feed-status { color: var(--blog-faint); font-size: 0.82rem; }
.feed-list { border: 0; }
.feed-item { padding: 2rem 0 2.2rem; border-bottom: 1px solid var(--blog-line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.65rem; color: var(--blog-faint); font-size: 0.75rem; letter-spacing: 0.04em; }
.feed-item__meta span { color: var(--blog-accent); }
.feed-item .feed-item__meta a { color: var(--blog-muted); border: 0; }
.feed-item .feed-item__meta a:hover { text-decoration: underline; }
.feed-item .feed-item__meta .feed-origin { margin: 0; }
.feed-item__meta time { color: var(--blog-accent); }
.feed-item h3 { margin: 0.65rem 0 0.45rem; font-size: 1.35rem; font-weight: 500; }
.feed-item p { white-space: pre-line; margin: 0 0 0.8rem; color: var(--blog-muted); font-size: 1rem; line-height: 1.8; }
.feed-body { margin-top: 0.8rem; }
.feed-item img.weibo-emoji { display: inline-block; width: 20px; height: 20px; margin: 0 1px; vertical-align: -4px; border: 0; border-radius: 0; box-shadow: none; }
.feed-quote { position: relative; isolation: isolate; margin: 1.2rem 0 0; padding: 1.5rem 1rem 1rem; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.feed-quote::before { content: ''; position: absolute; z-index: -1; top: 0; left: 0; width: 64px; height: 52px; background: var(--blog-accent); opacity: 0.12; pointer-events: none; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 52'%3E%3Cpath d='M27 3C10 7 2 18 2 34v15h25V25H14c1-8 5-13 13-17Zm35 0C45 7 37 18 37 34v15h25V25H49c1-8 5-13 13-17Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.feed-quote .feed-quote { margin-top: 1rem; padding-right: 0; }
.feed-item .feed-quote p { font-size: 0.88rem; line-height: 1.75; }
.feed-quote small { color: var(--blog-faint); }
.feed-quote p:last-child { margin-bottom: 0; }
.feed-body[data-collapsed="true"] { max-height: var(--excerpt-height, none); overflow: hidden; }
.feed-body[data-collapsed="true"]:has(+ .feed-expand:not([hidden])) { mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 1.4em), transparent 100%); }
.feed-body > :last-child { margin-bottom: 0; }
.feed-item { --media-max-size: 300px; }
.feed-images { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 0.8rem 0; width: 100%; max-width: var(--media-max-size); }
.feed-item .feed-image { border: 0; aspect-ratio: 1; overflow: hidden; border-radius: 6px; }
.feed-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-images:has(> .feed-image:nth-child(2):last-child) { grid-template-columns: repeat(2,minmax(0,1fr)); }
.feed-images:has(> .feed-image:only-child) { display: block; }
.feed-images > .feed-image:only-child { display: block; width: fit-content; max-width: 100%; aspect-ratio: auto; border-radius: 0; }
.feed-images > .feed-image:only-child img { width: auto; height: auto; max-width: 100%; max-height: var(--media-max-size); object-fit: contain; }
.image-viewer { padding: 0; border: 0; background: transparent; max-width: 95vw; max-height: 95vh; }
.image-viewer::backdrop { background: rgb(0 0 0 / 80%); }
.image-viewer-close:focus { outline: none; box-shadow: none; }
.image-viewer-close { -webkit-tap-highlight-color: transparent; }
.image-viewer > img { display: block; max-width: 90vw; max-height: 90vh; object-fit: contain; }
.image-viewer-close { position: fixed; right: 20px; top: 16px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; width: 40px; height: 40px; background: #000; color: #fff; box-shadow: none; text-shadow: none; font-size: 28px; font-weight: 300; line-height: 1; cursor: pointer; }
.feed-expand {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 8px 6px 8px 0; margin: 0.1rem 0 0.3rem;
  border: 0; background: none; color: var(--blog-accent);
  font: 400 13px/1.5 var(--article-sans); cursor: pointer;
}
.feed-expand::after {
  content: ''; width: 5px; height: 5px;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.feed-expand[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.feed-expand:hover { color: var(--blog-accent); }
.feed-expand:focus-visible { outline: 1px solid var(--blog-accent); outline-offset: 3px; }
@media (pointer: coarse) { .feed-expand { min-height: 44px; } }
.feed-expand[hidden] { display: none; }
.feed-item:has(.feed-expand:not([hidden])[aria-expanded="false"]) { cursor: pointer; }
.home-page .feed-body.markdown-section { max-width: none; min-height: 0; padding: 0; margin: 0.8rem 0 0; font-size: 1rem; overflow-wrap: anywhere; }
.feed-body.markdown-section p { white-space: normal; }
.home-page .feed-body.markdown-section h1 { font-size: 1.5rem; }
.feed-body.markdown-section h2 { margin-top: 1.8rem; font-size: 1.3rem; }
.feed-body.markdown-section h3 { margin-top: 1.4rem; font-size: 1.1rem; }
.feed-body.markdown-section pre { white-space: pre; }
.feed-more { display: block; margin: 1.5rem auto; padding: 0.65rem 1.1rem; border: 1px solid var(--blog-line); border-radius: 999px; color: var(--blog-ink); background: transparent; cursor: pointer; }
.feed-more:disabled { cursor: default; opacity: 0.45; }
.feed-more[hidden] { display: none; }
.feed-status { min-height: 1.5em; text-align: center; }
.legacy-index { padding-top: 80px; padding-bottom: 100px; color: var(--blog-muted); }
.legacy-index ul { padding-left: 0; list-style: none; }
.legacy-index li { margin: 0.8rem 0; }
.legacy-index time { display: inline-block; width: 6rem; color: var(--blog-faint); font-size: 0.82rem; }
@media (max-width: 600px) { .profile-intro,.feed-section,.legacy-index,.resume { padding-left: 20px; padding-right: 20px; } .section-heading { align-items: start; flex-direction: column; gap: 0; } .feed-item p { font-size: 0.98rem; } }

.home-page .markdown-section blockquote {
  margin: 0 0 2.4rem;
  padding: 0;
  border: 0;
  color: var(--blog-muted);
  font-size: 0.94rem;
}

.home-page .markdown-section h2 {
  margin: 2.7rem 0 0.75rem;
  font-size: 1.18rem;
}

.home-page .markdown-section h3 {
  margin: 1.65rem 0 0.55rem;
  color: var(--blog-muted);
  font-size: 0.92rem;
}

.home-page .markdown-section ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.home-page .markdown-section ul li {
  padding: 0.16rem 0;
  font-size: 0.94rem;
  line-height: 1.75;
}

.home-page .markdown-section ul li .tl-date {
  display: inline-block;
  min-width: 2.65rem;
  margin-right: 0.35rem;
  color: var(--blog-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
}

.home-page .markdown-section a {
  color: var(--blog-ink);
  font-size: 0.88rem;
  font-weight: 400;
  text-decoration: none;
}

.home-page .markdown-section a:hover { color: var(--blog-accent); }

/* Footer and contact icons */
.blog-footer {
  max-width: var(--blog-reader-width);
  padding: 0 32px 48px;
  margin: 0 auto;
  color: var(--blog-faint);
  font-size: 0.76rem;
  text-align: center;
}

.blog-footer__contacts {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.blog-footer__icon {
  display: inline-grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  color: var(--blog-muted);
  border: 1px solid var(--blog-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.blog-footer__icon:hover {
  color: var(--blog-accent);
  border-color: rgba(217, 77, 122, 0.45);
  background: var(--blog-accent-wash);
  transform: translateY(-2px);
}

.blog-footer__icon svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.blog-footer__icp {
  color: var(--blog-faint);
  text-decoration: none;
}

.blog-footer__icp:hover { color: var(--blog-accent); }

@media (max-width: 1120px) {
  .article-page .blog-reading-layout {
    display: block;
    max-width: var(--blog-content-width);
    padding: 56px 32px 64px;
  }

  .article-toc { display: none; }
}

@media (max-width: 700px) {
  .markdown-section,
  .article-page .blog-reading-layout {
    padding-right: 20px;
    padding-left: 20px;
  }

  .article-page .blog-reading-layout { padding-top: 40px; }

  .markdown-section {
    font-size: 16px;
    line-height: 1.85;
  }

  .markdown-section h1 { font-size: 2rem; }
  .markdown-section h2 { font-size: 1.36rem; }

  .home-page .markdown-section {
    min-height: calc(100vh - 144px);
    padding-top: clamp(56px, 14vh, 90px);
  }

  .home-page .markdown-section h1 { font-size: clamp(2.5rem, 13vw, 3.25rem); }

  .home-page .markdown-section ul li { font-size: 0.9rem; }

  .blog-footer { padding: 0 20px 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.feed-videos { display: grid; gap: 0.8rem; margin: 0.8rem 0; max-width: var(--media-max-size); }
.feed-video { display: block; width: auto; height: auto; max-width: min(100%, var(--media-max-size)); max-height: var(--media-max-size); border-radius: 6px; background: #111; object-fit: contain; }

.feed-item .feed-original { display: inline-block; margin-top: 0.5rem; font-size: 0.8rem; color: var(--blog-accent); border-bottom: 0; text-decoration: none; }
.feed-item .feed-original::after { content: '↗'; display: inline-block; margin-left: 0.3em; font-size: 0.85em; opacity: 0.75; }
.feed-body a { overflow-wrap: anywhere; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.feed-search { margin: 0 0 0.65rem; }
.feed-search__row { display: flex; align-items: center; margin-left: auto; width: 36px; height: 36px; border: 1px solid transparent; border-radius: 999px; overflow: hidden; transition: width 180ms ease, border-color 180ms ease, background 180ms ease; }
.feed-search[data-open="true"] .feed-search__row { width: min(320px, 100%); border-color: var(--blog-line); background: rgba(128,116,100,0.035); }
.feed-search__row:focus-within { border-color: color-mix(in srgb, var(--blog-accent) 35%, var(--blog-line)); }
.feed-search button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: var(--blog-faint); cursor: pointer; }
.feed-search button:hover { color: var(--blog-accent); }
.feed-search button:focus-visible { outline: 2px solid var(--blog-accent); outline-offset: 2px; }
.feed-search svg { width: 18px; height: 18px; }
.search-panel { display: flex; align-items: center; flex: 1; min-width: 0; }
.search-panel[hidden] { display: none; }
/* Reveal controls only once the expanding shell can contain them. */
.feed-search[data-open="true"] .search-panel {
  animation: search-controls-reveal 120ms ease 180ms both;
}
@keyframes search-controls-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}
.feed-search button:focus-visible { outline-offset: -3px; }

.feed-search input[type="search"] { min-width: 0; width: 100%; flex: 1; padding: 0; border: 0; outline: 0; border-radius: 0; background: transparent; color: var(--blog-ink); font: inherit; font-size: 16px; }
.feed-search input[type="search"]::placeholder { color: var(--blog-faint); font-size: 0.82rem; }
.feed-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.search-regex { display: grid; place-items: center; width: 26px; height: 34px; margin-right: -3px; flex-shrink: 0; cursor: pointer; }
.search-regex span { display: grid; place-items: center; width: 25px; height: 24px; border-radius: 5px; color: var(--blog-faint); font: 15px ui-monospace, monospace; transition: color 150ms ease, background 150ms ease; }
.search-regex input:checked + span { color: var(--blog-accent); background: color-mix(in srgb, var(--blog-accent) 10%, transparent); }
.search-regex input:focus-visible + span { outline: 2px solid var(--blog-accent); }
.search-summary { margin: 0.45rem 0 0; text-align: right; font-size: 0.78rem; color: var(--blog-faint); }
.search-summary:empty { display: none; }

.profile-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 1.25rem; }
.profile-heading .notes-title { margin-bottom: 0; }
.markdown-link { white-space: nowrap; font-size: 12px; color: var(--blog-accent); text-decoration: none; }
.profile-markdown { margin-top: 4px; flex-shrink: 0; }
.profile-markdown:hover { color: var(--blog-accent); }
.profile-toolbar { display: flex; align-items: center; gap: 12px; }
.profile-toolbar .profile-links { flex-shrink: 0; flex-wrap: nowrap; }
.profile-toolbar .feed-search { flex: 1; min-width: 0; margin: 0 0 0 auto; }
.feed-section { padding-top: 16px; }
.feed-list > .feed-item:first-child { padding-top: 32px; }

/* Shared copy controls for resume and timeline code blocks. */
  pre.has-copy { position: relative; margin: 16px 0; padding: 16px 56px 16px 18px; transition: background-color 160ms ease; }
  .copy-code { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; display: grid; place-items: center; padding: 8px; opacity: 0; transition: opacity 160ms ease; border: 0; border-radius: 4px; background: transparent; color: var(--blog-muted); font: inherit; cursor: pointer; }
  pre code { display: block; font: inherit; background: transparent; padding: 0; }
  .copy-code svg { display: block; width: 16px; height: 16px; }
  pre.has-copy:hover, pre.has-copy:focus-within { background-color: rgba(217, 77, 122, 0.045); }
  pre:hover .copy-code, pre:focus-within .copy-code { opacity: 1; }
  @media (hover: none), (pointer: coarse) { .copy-code { opacity: 1; width: 44px; height: 44px; } }
  @media (prefers-reduced-motion: reduce) { .copy-code, pre.has-copy { transition: none; } }
  .copy-code:hover, .copy-code:focus-visible { color: var(--blog-accent); }
  .copy-code:focus-visible { outline: 1px solid var(--blog-accent); }
  @media print { .copy-code { display: none; } pre.has-copy { padding-top: 0; } }

.feed-item h3 a,.feed-item__meta a{color:inherit} #feed-up{display:block;margin:20px auto} #feed-up[hidden],#feed-down[hidden]{display:none} .feed-item{overflow-anchor:auto}
/* Permalinks preserve the original title and date typography. */
.feed-item > h3 > a, .feed-item__meta a:has(time) { color: inherit; border-bottom: 0; text-decoration: none; }

/* Editorial reading with sans-serif typography and restrained rose accents. */
:root {
  --article-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.profile-intro, .feed-section { max-width: 744px; }
.profile-heading .notes-title { font-family: var(--article-sans); font-size: clamp(30px, 5vw, 42px); font-weight: 300; letter-spacing: -0.025em; }
.feed-item { padding: 32px 0; }
.feed-item > :last-child { margin-bottom: 0; }
@media (max-width: 600px) {
  .feed-item, .feed-list > .feed-item:first-child { padding-top: 24px; padding-bottom: 24px; }
}
.feed-item__meta { font-family: var(--article-sans); font-size: 12px; letter-spacing: 0.025em; }
.feed-item__meta time { color: var(--blog-accent); }
.feed-item > h3 {
  margin: 0.65rem 0 1.35rem;
  color: #47423e;
  font-family: var(--article-sans);
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.025em;
  text-wrap: pretty;
}
.feed-item > h3 > a { color: inherit; font-weight: inherit; }
.home-page .feed-body.markdown-section {
  font-family: var(--article-sans);
  font-size: 17px;
  line-height: 1.95;
  min-height: 0;
  padding: 0;
  margin-top: 1rem;
}
.home-page .feed-body.markdown-section :is(p, li) {
  color: #58534e;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
}
.home-page .feed-body.markdown-section p { margin: 0 0 1.15em; white-space: normal; }
.home-page .feed-body.markdown-section :is(h1,h2,h3,h4,h5,h6) {
  color: var(--blog-accent);
  font-family: var(--article-sans);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-wrap: pretty;
}
.home-page .feed-body.markdown-section h1 { font-size: 25px; margin: 2rem 0 0.9rem; }
.home-page .feed-body.markdown-section h2 { font-size: 21px; margin: 2.6rem 0 1rem; }
.home-page .feed-body.markdown-section h3 { font-size: 18px; margin: 1.9rem 0 0.8rem; }
.home-page .feed-body.markdown-section :is(h4,h5,h6) { font-size: 16px; margin: 1.6rem 0 0.7rem; }
.home-page .feed-body.markdown-section strong { color: inherit; font-weight: 500; }
.home-page .feed-body.markdown-section :is(ul,ol) { margin: 1.1em 0; padding-left: 1.5em; }
.home-page .feed-body.markdown-section ul { list-style: disc; }
.home-page .feed-body.markdown-section ul ul { list-style: circle; }
.home-page .feed-body.markdown-section li { padding: 0; margin: 0.4em 0; }
.home-page .feed-body.markdown-section li > p { margin-bottom: 0.4em; }
.home-page .feed-body.markdown-section a { font-size: inherit; font-weight: inherit; color: inherit; border-bottom-color: var(--blog-accent); }
.home-page .feed-body.markdown-section a:hover { color: var(--blog-accent); }
.home-page .feed-body.markdown-section blockquote {
  margin: 1.5rem 0;
  padding: 0.15em 0 0.15em 1.1rem;
  border-left: 2px solid var(--blog-accent);
}
.home-page .feed-body.markdown-section blockquote,
.home-page .feed-body.markdown-section blockquote :is(p,li,strong) {
  font-size: 15px;
  line-height: 1.9;
  color: #807970;
}
.home-page .feed-body.markdown-section blockquote > :first-child { margin-top: 0; }
.home-page .feed-body.markdown-section blockquote > :last-child { margin-bottom: 0; }
.feed-body.markdown-section mark {
  color: inherit;
  background: var(--blog-accent-wash);
  padding: 0.05em 0.14em;
  border-radius: 0;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.feed-body.markdown-section img { border: 0; border-radius: 0; box-shadow: none; }
.home-page .feed-body.markdown-section pre {
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 0;
  border-left: 2px solid var(--blog-line);
  border-radius: 0;
  background: #f7f3ef;
}
.home-page .feed-body.markdown-section :not(pre) > code { font-size: 0.85em; padding: 0.1em 0.25em; }
.home-page .feed-body.markdown-section table { font-family: var(--article-sans); font-size: 14px; line-height: 1.7; border-radius: 0; }
.home-page .feed-body.markdown-section :is(th,td) { border-bottom: 1px solid var(--blog-line); text-align: left; }
#feed-up { border: 0; background: transparent; color: var(--blog-muted); font: 13px var(--article-sans); cursor: pointer; padding: 12px; }
@media (max-width: 600px) {
  .profile-intro, .feed-section { padding-left: 22px; padding-right: 22px; }
  .feed-item > h3 { font-size: 23px; line-height: 1.45; }
  .home-page .feed-body.markdown-section { font-size: 16px; line-height: 1.95; }
  .home-page .feed-body.markdown-section h2 { font-size: 20px; margin-top: 2rem; }
  .home-page .feed-body.markdown-section h3 { font-size: 17px; }
  .home-page .feed-body.markdown-section blockquote { padding-left: 0.9rem; }
}

/* A section pause inside an article differs from a timeline entry boundary. */
.home-page .feed-body.markdown-section hr {
  width: 48px;
  height: 1px;
  margin: 2.2rem auto;
  border: 0;
  background: var(--blog-accent);
  opacity: 0.45;
}


/* Extend the reading cue into the gutter without moving article content. */
@media (hover: hover) and (pointer: fine) {
  .feed-item { position: relative; isolation: isolate; }
  .feed-item::before {
    content: '';
    position: absolute;
    inset: 0 -24px;
    z-index: -1;
    pointer-events: none;
    background: #faf7f4;
    opacity: 0;
    transition: opacity 160ms ease;
  }
  .feed-item:hover::before { opacity: 1; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 600px) {
  .feed-item::before { left: -16px; right: -16px; }
}
@media (prefers-reduced-motion: reduce) {
  .feed-item::before { transition: none; }
}

/* Timeline dividers align with the hover surface; in-article rules stay short. */
@media (hover: hover) and (pointer: fine) {
  .feed-item { border-bottom-color: transparent; }
  .feed-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -24px;
    right: -24px;
    bottom: -1px;
    height: 1px;
    background: var(--blog-line);
    pointer-events: none;
  }
}
@media (hover: hover) and (pointer: fine) and (max-width: 600px) {
  .feed-item:not(:last-child)::after { left: -16px; right: -16px; }
}

/* Rose bullets give lists structure without colouring their text. */
.home-page .feed-body.markdown-section ul { padding-left: 1.4em; }
.home-page .feed-body.markdown-section ul > li { padding-left: 0.25em; margin: 0.55em 0; }
.home-page .feed-body.markdown-section ul > li::marker { color: var(--blog-accent); font-size: 0.85em; }
.home-page .feed-body.markdown-section ul :is(ul,ol) { margin: 0.45em 0; }
.home-page .feed-body.markdown-section ol > li::marker { color: var(--blog-accent); }

/* Timeline boundaries use the same quiet tone as the reading surface. */
.feed-item { border-bottom-color: #faf7f4; }
@media (hover: hover) and (pointer: fine) {
  .feed-item { border-bottom-color: transparent; }
  .feed-item:not(:last-child)::after { background: #faf7f4; }
}
@media (prefers-reduced-motion: reduce) {
  .feed-search[data-open="true"] .search-panel { animation: none; }
}

#feed-up, #feed-down { border: 0; border-radius: 0; background: transparent; color: var(--blog-accent); font: 400 13px/1.5 var(--article-sans); min-height: 40px; }
