/* 随轩 · 改版预览 · article skeleton
   hero (each room builds its own) → body grid (contents | text | margin) → end matter.
   Room decorations in the text sit behind .deco on the root; the 素读 button swaps .deco for .is-plain. */

.ah { position: relative; }
.ah__cat { text-decoration: none; }
.ah__t { word-break: keep-all; overflow-wrap: anywhere; }
.cmt__au { margin-left: 8px; padding: 0 6px; font-size: 12px; border: 1px solid currentColor; }
.ah__meta { display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 14px; }
.ah__meta div { display: flex; gap: 8px; }
.ah__meta dt { color: var(--muted); }
.ah__meta dd { font-variant-numeric: tabular-nums; }

/* ---------- body grid ---------- */
.ag {
  display: grid; grid-template-columns: 200px minmax(0, 700px) 220px; gap: 56px; justify-content: center; align-items: start;
  width: min(1240px, calc(100% - 64px)); margin: 72px auto 0;
}
.toc { position: sticky; top: 100px; font-size: 14px; line-height: 1.5; }
.toc h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; letter-spacing: .04em; }
.toc ol { display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 10px; text-decoration: none; color: var(--muted); border-radius: 4px; transition: background-color .2s, color .2s; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { color: var(--ink); background: color-mix(in srgb, var(--acc) 14%, transparent); }

.prose { min-width: 0; font-family: var(--f-body); font-size: 17.5px; line-height: 2; letter-spacing: .01em; color: var(--ink); text-align: justify; hanging-punctuation: allow-end; }
/* English: ragged right reads better than justified lines with wide gaps */
.prose:lang(en) { text-align: left; letter-spacing: 0; line-height: 1.8; hyphens: auto; -webkit-hyphens: auto; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { margin-top: 2.3em; font-size: 25px; line-height: 1.45; text-align: left; letter-spacing: .02em; }
.prose h3 { margin-top: 1.9em; font-size: 21px; line-height: 1.5; text-align: left; }
.prose ul, .prose ol { display: grid; gap: .35em; padding-left: 1.6em; }
.prose ul > li { list-style: disc; }
.prose ol > li { list-style: decimal; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.prose figure { margin-top: 2em; margin-bottom: 2em; }
.prose figure img { width: 100%; height: auto; }
.prose figcaption { margin-top: 10px; font-size: 14px; line-height: 1.6; color: var(--muted); text-align: left; }
.prose blockquote { font-size: 17px; }
.prose sup { font-size: 12px; line-height: 0; }
.prose .lead { font-size: 19px; line-height: 1.95; }

/* the preview stops after two sections */
.cut { position: relative; margin-top: 0 !important; padding-top: 80px; text-align: center; font-size: 14px; color: var(--muted); }
.cut::before { content: ""; position: absolute; left: 0; right: 0; top: -150px; height: 150px; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.cut a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 20px; border: 1.5px solid var(--ink); color: var(--ink); text-decoration: none; font-size: 15px; }
.cut a:hover { background: var(--ink); color: var(--bg); }

/* margin rail: reader notes live here */
.rail { position: sticky; top: 100px; display: grid; gap: 18px; font-size: 14px; line-height: 1.7; }
.rail__note { padding: 14px 16px; }
.rail__note b { display: block; font-size: 13px; margin-bottom: 4px; }
.rail__note p { color: var(--muted); }
.rail__btn { justify-self: start; display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); font-size: 13px; text-decoration: none; }

/* ---------- end matter ---------- */
.ae { display: grid; gap: 60px; width: min(940px, calc(100% - 64px)); margin: 88px auto 0; }
.ae h2 { font-size: 15px; font-weight: 600; letter-spacing: .04em; margin-bottom: 16px; }
.author { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 24px; align-items: center; padding: 26px 28px; }
.author img { width: 88px; height: 88px; object-fit: cover; }
.author h3 { font-size: 19px; }
.author h3 small { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.author p { margin-top: 6px; font-size: 14.5px; line-height: 1.75; color: var(--muted); }
.author nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; }
.author nav a { text-decoration: underline; text-underline-offset: 3px; }

.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.pn > div { display: grid; gap: 10px; align-content: start; }
.pn__l { font-size: 13px; color: var(--muted); }
.pn > div:last-child .pn__l { text-align: right; }
.rel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.cmt__list { display: grid; gap: 14px; }
.cmt__one { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px 18px; }
.cmt__one i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 15px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.cmt__one b { font-size: 14px; }
.cmt__one time { margin-left: 10px; font-size: 12.5px; color: var(--muted); }
.cmt__one p { margin-top: 4px; font-size: 15px; line-height: 1.75; }
.cmt__one--reply { margin-left: 54px; }
.cmt__form { display: grid; gap: 10px; margin-top: 16px; }
.cmt__form label { font-size: 13px; color: var(--muted); }
.cmt__form textarea { width: 100%; min-height: 96px; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--ink); background: transparent; border: 1px solid var(--line); resize: vertical; }
.cmt__form button { justify-self: end; min-height: 44px; padding: 0 22px; background: var(--ink); color: var(--bg); }
.cmt__empty { font-size: 15px; color: var(--muted); }

/* ---------- 素读: plain reading, any room ----------
   Room decorations live behind .deco; these overrides also beat each room's own panel styling. */
.is-plain *, .is-plain *::before, .is-plain *::after { animation: none !important; transition: none !important; }
.yh.is-plain .prose {
  --ink: #1E1E1E; --muted: #555555; --line: rgba(0, 0, 0, .14);
  padding: 44px 52px; color: #1E1E1E; background: #FFFFFF; border: 0; outline: 0; border-radius: 0;
  font-family: var(--f-ui); font-size: 18px; line-height: 1.95; text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 20px 40px -30px rgba(0, 0, 0, .3);
}
.yh.is-plain .prose::before { display: none; }
.yh.is-plain .prose > * + * { margin-top: 1.1em; }
.yh.is-plain .prose p { text-indent: 0; }
.yh.is-plain .prose a { color: #1A4FB4; }
.yh.is-plain .prose :is(h2, h3) { margin-top: 2em; font-family: var(--f-ui); font-weight: 700; color: #111111; }
.yh.is-plain .prose blockquote { padding-left: 18px; border-left: 3px solid #D0D0D0; color: #444444; }
.yh.is-plain .prose > :first-child { padding: 0; background: none; border: 0; font-size: inherit; color: #555555; }
.yh.is-plain .cut { margin: 0 !important; padding: 80px 0 0; background: none; }
.yh.is-plain .cut::before { background: linear-gradient(rgba(255, 255, 255, 0), #FFFFFF); }
.yh.is-plain .cut a { border: 1.5px solid #1E1E1E; background: none; color: #1E1E1E; box-shadow: none; font-family: var(--f-ui); }
.yh.is-plain .rail { display: none; }
.yh.is-plain .ag { grid-template-columns: 200px minmax(0, 760px); }

/* ---------- phone ---------- */
@container yh (max-width: 760px) {
  .ag { grid-template-columns: minmax(0, 1fr); gap: 0; width: calc(100% - 32px); margin-top: 40px; }
  .toc, .rail { display: none; }
  .yh.is-plain .ag { grid-template-columns: minmax(0, 1fr); }
  .yh.is-plain .prose { padding: 26px 20px; }
  .prose { font-size: 17px; line-height: 1.95; text-align: left; }
  .prose h2 { font-size: 22px; }
  .ae { width: calc(100% - 32px); gap: 44px; margin-top: 64px; }
  .author { grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 20px; }
  .author img { width: 64px; height: 64px; }
  .pn, .rel { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .pn > div:last-child .pn__l { text-align: left; }
  .cmt__one--reply { margin-left: 26px; }
}

/* ---------- theme additions: grid areas, middle widths, folded contents ---------- */
.ag { grid-template-areas: "toc text rail"; }
.ag > .toc { grid-area: toc; }
.ag > .toc-m { grid-area: tocm; }
.ag > .prose { grid-area: text; }
.ag > .rail { grid-area: rail; }
.yh.is-plain .ag { grid-template-areas: "toc text"; }
.toc--none { min-height: 1px; }
.toc-m summary { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; cursor: pointer; font-size: 15px; font-weight: 600; list-style: none; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, #FFFFFF); }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after { content: ""; width: 8px; height: 8px; margin-left: auto; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.toc-m[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.toc-m summary small { font-weight: 400; color: var(--muted); }
.toc-m ol { display: grid; gap: 0; max-height: 50vh; overflow-y: auto; padding: 6px 0; border: 1px solid var(--line); border-top: 0; background: color-mix(in srgb, var(--bg) 85%, #FFFFFF); }
.toc-m a { display: block; padding: 8px 16px; color: var(--ink); text-decoration: none; font-size: 15px; line-height: 1.5; }
.toc-m .toc--h3 a { padding-left: 32px; font-size: 14px; color: var(--muted); }
.toc-m a[aria-current="true"] { font-weight: 700; box-shadow: inset 3px 0 0 var(--acc); }
@container yh (max-width: 1180px) {
  .ag { grid-template-columns: minmax(0, 700px) 210px; grid-template-areas: "tocm rail" "text rail"; gap: 0 44px; }
  .w-site .ag { grid-template-columns: minmax(0, 720px) 200px; }
  .ag > .toc { display: none; }
  .ag > .toc-m { display: block; margin-bottom: 26px; }
  .yh.is-plain .ag { grid-template-columns: minmax(0, 760px); grid-template-areas: "tocm" "text"; }
}
@container yh (max-width: 980px) {
  .ag, .w-site .ag { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tocm" "text"; gap: 0; width: min(720px, calc(100% - 48px)); }
  .w-site .ag { width: auto; }
  .ag > .rail { display: none; }
}
@container yh (max-width: 760px) {
  .ag, .w-site .ag { width: calc(100% - 32px); }
  .w-site .ag { width: auto; grid-template-areas: "tocm" "text" "rail"; }
  .ag > .toc-m { margin-bottom: 20px; }
}

/* Web3: one picture in the flow, a pixel copy laid over it by the script */
.w-web3 .ah__pic img.ah__base { position: static; opacity: 1; image-rendering: auto; }
.w-web3 .ah__px { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; transition: opacity .45s steps(5); }
.w-web3 .ah__pic.is-orig .ah__px { opacity: 0; }
:lang(en) .w-cult .tabs li:has(.is-torn)::after { content: "Copied"; }

/* comments: the theme's markup (replies nest inside their parent) */
.cmt__list > li + li { margin-top: 14px; }
.cmt__one { align-items: start; }
.cmt__one > .children { grid-column: 1 / -1; display: grid; gap: 12px; margin: 10px 0 0 54px; }
.cmt__one--reply { padding: 12px 0 0 16px; border-left: 2px solid var(--line); background: none; box-shadow: none; transform: none; }
.cmt__one--reply::before { display: none; }
.cmt__main { min-width: 0; }
.cmt__au { margin-left: 8px; }
.cmt__time { margin-left: 10px; font-size: 12.5px; color: var(--muted); text-decoration: none; }
.cmt__time:hover { text-decoration: underline; }
.cmt__txt { margin-top: 2px; font-size: 15px; line-height: 1.8; overflow-wrap: anywhere; }
.cmt__txt p { margin-top: 4px; }
.cmt__txt .yhm-comment-quote { margin: 6px 0 8px; padding: 6px 12px; font-size: 13.5px; line-height: 1.7; color: var(--muted); border-left: 3px solid var(--acc); background: color-mix(in srgb, var(--ink) 5%, transparent); cursor: pointer; }
.cmt__re { margin-top: 6px; font-size: 13px; }
.cmt__re a { color: var(--muted); }
.cmt__wait { font-size: 13px; color: var(--acc); }
.cmt__n { font-weight: 400; color: var(--muted); }
.cmt__pings { margin-top: 18px; font-size: 14px; color: var(--muted); }
.cmt__pings summary { cursor: pointer; }
.cmt__pings ul { display: grid; gap: 4px; margin-top: 8px; padding-left: 1.2em; }
.cmt__pings li { list-style: disc; }
.cmt__closed { margin-top: 18px; font-size: 14px; color: var(--muted); }
.comment-respond { margin-top: 26px; }
.cmt__title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.cmt__title small { margin-left: 10px; font-size: 13px; font-weight: 400; }
.cmt__form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cmt__form > p { display: grid; gap: 4px; }
.cmt__form .comment-form-comment, .cmt__form .comment-form-cookies-consent, .cmt__form .form-submit, .cmt__form .logged-in-as, .cmt__form > :not(p) { grid-column: 1 / -1; }
.cmt__form label { font-size: 13px; color: var(--muted); }
.cmt__form .req { margin-left: 2px; font-size: 12px; }
.cmt__form input[type="text"], .cmt__form input[type="email"], .cmt__form input[type="url"] { width: 100%; height: 42px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--ink); background: transparent; border: 1px solid var(--line); }
.cmt__form .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.cmt__form .comment-form-cookies-consent label { font-size: 13px; }
.cmt__form .form-submit { display: flex; justify-content: flex-end; }
.cmt__form .submit { min-height: 44px; padding: 0 22px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-size: 15px; cursor: pointer; }
.cmt__form .submit:hover { background: var(--acc); color: var(--acc-ink); }
@container yh (max-width: 760px) {
  .cmt__form { grid-template-columns: minmax(0, 1fr); }
  .cmt__one { padding: 14px 14px; }
}
