/* 「相」样张 D2 + 往期 —— 界面往后退，作品往前站 */
:root { --mat: color-mix(in srgb, var(--paper) 45%, #fff); }
:root[data-theme="dark"] { --mat: #232220; }
.x-body { --vt: calc(env(safe-area-inset-top) + 46px); --sb: env(safe-area-inset-bottom);
  margin: 0; height: 100%; overflow: hidden; background: #1a1918; color: var(--ink); -webkit-tap-highlight-color: transparent; }
html:has(.x-body) { height: 100%; }
.x-mono { font: 10.5px/1.6 var(--font-mono); letter-spacing: .18em; color: var(--ink-3); }
.x-no { color: var(--cinnabar); }
.x-stage { position: relative; height: 100svh; max-width: 460px; margin: 0 auto; background: var(--paper); overflow: hidden; }
.x-feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.x-feed::-webkit-scrollbar { display: none; }
.x-stage.is-locked .x-feed { overflow: hidden; }
.x-screen { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.x-bars { position: absolute; z-index: 9; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 10px); display: flex; gap: 4px; pointer-events: none; transition: opacity .4s; }
.x-bars.is-hidden { opacity: 0; }
.x-bars i { flex: 1; height: 2px; background: color-mix(in srgb, var(--ink) 14%, transparent); }
.x-bars i.on { background: var(--ink); }
.x-top { position: absolute; z-index: 5; left: 20px; right: 20px; top: calc(env(safe-area-inset-top) + 22px); display: flex; justify-content: space-between; pointer-events: none; }

/* —— 封面：像一本小刊物的扉页 —— */
.x-cover { display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 26px) 26px calc(var(--sb) + 30px); }
.x-cover__top { display: flex; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 10px; }
.x-cover__mid { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 18px; margin-top: auto; }
.x-cover h1 { margin: 0; font: 900 clamp(110px, 34vw, 150px)/.86 var(--font-display); letter-spacing: -.02em; }
.x-cover__term { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.x-cover__term b { font: 700 26px/1 var(--font-display); }
.x-cover__term span { font: 13px/1.6 var(--font-display); color: var(--ink-2); }
.x-cover__line { grid-column: 1 / -1; margin: 22px 0 0; font: 400 17px/1.95 var(--font-display); color: var(--ink-2); }
.x-cover__list { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.x-cover__list li { display: grid; grid-template-columns: 34px 1fr auto; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font: 500 16px/1.4 var(--font-display); }
.x-cover__list em { font: 10.5px var(--font-mono); font-style: normal; letter-spacing: .06em; color: var(--ink-3); }
.x-hint { margin: 22px auto 0; font: 10.5px var(--font-mono); letter-spacing: .3em; color: var(--ink-3); animation: x-bob 2.6s ease-in-out infinite; }
@keyframes x-bob { 50% { transform: translateY(-5px); } }

/* —— 作品：卡纸装裱 —— */
.x-view { position: absolute; left: 0; right: 0; top: var(--vt); height: calc(100% - var(--vt) - var(--sb) - 132px); overflow: hidden; transition: height .55s var(--ease); }
.x-mat { position: absolute; background: var(--mat); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 22px 36px -26px rgba(0,0,0,.45); transition: opacity .4s; }
.x-img { position: absolute; display: block; transform-origin: 0 0; transition: transform .75s var(--ease); background: var(--paper-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mat) 50%, #fff), 0 0 0 4px rgba(0,0,0,.12); }
:root[data-theme="dark"] .x-img { box-shadow: 0 0 0 3px #2c2b28, 0 0 0 4px rgba(255,255,255,.06); }
.x-placard { position: absolute; left: 26px; right: 26px; bottom: calc(var(--sb) + 30px); max-width: 320px; padding-top: 12px; border-top: 1px solid var(--ink);
  display: flex; flex-direction: column; gap: 2px; opacity: 0; transform: translateY(6px); transition: opacity 1.2s ease, transform 1.2s var(--ease); pointer-events: none; }
.x-placard b { font: 900 23px/1.3 var(--font-display); }
.x-tap { margin-top: 8px; font: 12px var(--font-display); color: var(--cinnabar); }
.x-work.is-labelled .x-placard { opacity: 1; transform: none; }
.x-work.is-reading .x-placard { opacity: 0; transition-duration: .2s; }

/* 读：作品缩到上面，解说从下面升起 */
.x-work.is-reading .x-view { height: calc(40% - var(--vt) + 4px); }
.x-work.is-reading .x-top .x-mono:last-child { opacity: 0; }
.x-read { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; top: 40%; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px calc(var(--sb) + 26px);
  background: var(--paper); border-top: 1px solid var(--line-soft); transform: translateY(102%); transition: transform .55s var(--ease); }
.x-work.is-reading .x-read { transform: none; }
.x-k { color: var(--ink); font-weight: 600; letter-spacing: .26em; }
.x-lede { margin: 8px 0 18px; font: 700 20px/1.65 var(--font-display); }
.x-brace { display: grid; grid-template-columns: minmax(0, 1fr) 16px 22px; column-gap: 6px; }
.x-spots { list-style: none; margin: 0; padding: 0; }
.x-spots li + li { margin-top: 12px; }
.x-spots button { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer; }
.x-spots i { flex: none; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--cinnabar); border-radius: 50%; font: 600 10.5px var(--font-mono); font-style: normal; color: var(--cinnabar); transition: background .3s, color .3s; }
.x-spots b { font: 600 16px/1.4 var(--font-display); transition: color .3s; }
.x-spots button.is-on i { background: var(--cinnabar); color: #fff; }
.x-spots button.is-on b { color: var(--cinnabar); }
.x-spots p { margin: 4px 0 0 29px; font: 400 14.5px/1.85 var(--font-display); color: var(--ink-2); }
.x-brace__line { width: 16px; height: 100%; fill: none; stroke: var(--ink-3); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.x-brace__sum { align-self: center; writing-mode: vertical-rl; font: 600 15px/1 var(--font-display); letter-spacing: .32em; }
.x-dims { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.x-dims span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 8px; border: 1px solid var(--line-soft); border-radius: 13px; font: 12.5px var(--font-display); color: var(--ink-2); }
.x-glyph { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.1; }
.x-chips { display: flex; gap: 10px; margin-top: 16px; min-height: 22px; }
.x-chips span { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.x-chips i { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.x-chips em { font: 8.5px var(--font-mono); font-style: normal; color: var(--ink-3); }
.x-src { margin-top: 16px; font-size: 9.5px; letter-spacing: .08em; }
.x-acts { display: flex; gap: 8px; margin-top: 20px; }
.x-acts > * { flex: 1; height: 44px; display: grid; place-items: center; border: 1px solid var(--ink); background: none; font: 14px var(--font-display); color: var(--ink); text-decoration: none; cursor: pointer; }
.x-acts .x-main { flex: 1.4; background: var(--ink); color: var(--paper); }

/* 画上的看点标记 */
.x-pin { position: absolute; z-index: 3; width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--cinnabar); color: #fff; font: 600 11px var(--font-mono); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cinnabar) 25%, transparent);
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s var(--ease); pointer-events: none; cursor: pointer; }
.x-work.is-reading:not(.is-zoomed) .x-pin { opacity: 1; transform: none; pointer-events: auto; transition-delay: .45s; }

/* 双击 = 盖印 */
.x-seal { position: absolute; z-index: 7; left: 50%; top: 46%; width: 84px; height: 84px; margin: -42px; display: grid; place-items: center; background: var(--cinnabar); color: #fff;
  font: 900 44px/1 var(--font-display); transform: rotate(-8deg) scale(2); opacity: 0; pointer-events: none; }
.x-seal.is-on { animation: x-stamp 1.1s var(--ease) forwards; }
@keyframes x-stamp { 0% { transform: rotate(-8deg) scale(2); opacity: 0; } 25% { transform: rotate(-8deg) scale(.92); opacity: 1; } 70% { opacity: 1; } 100% { transform: rotate(-8deg) scale(1); opacity: 0; } }
.x-liked { position: absolute; z-index: 4; width: 24px; height: 24px; display: none; place-items: center; background: var(--cinnabar); color: #fff; font: 900 12px var(--font-display); transform: rotate(-6deg); }
.x-work.is-liked .x-liked { display: grid; }

/* —— 另一种做法 —— */
.x-pair { display: flex; flex-direction: column; padding: calc(var(--vt) + 14px) 22px calc(var(--sb) + 22px); }
.x-pair__q { margin: 0 0 14px; font: 700 23px/1.45 var(--font-display); }
.x-pair__q .x-mono { display: block; margin-bottom: 4px; color: var(--cinnabar); }
.x-pair__two { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.x-pair figure { position: relative; flex: 1; min-height: 0; margin: 0; display: grid; grid-template-columns: 46% minmax(0, 1fr); gap: 14px; align-items: center; }
.x-pair__img { height: 100%; min-height: 0; display: grid; place-items: center; }
.x-pair__img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; box-sizing: border-box; padding: 7px; background: var(--mat);
  box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 14px 24px -18px rgba(0,0,0,.45); }
.x-work.is-zoomed .x-mat { opacity: 0; }
.x-pair figcaption { font: 400 14.5px/1.85 var(--font-display); color: var(--ink-2); }
.x-pair figcaption b { display: block; margin-bottom: 2px; font: 600 15px var(--font-display); color: var(--ink); }
.x-pair__or { display: flex; align-items: center; gap: 10px; font: 10.5px var(--font-mono); letter-spacing: .3em; color: var(--ink-3); }
.x-pair__or::before, .x-pair__or::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.x-pair__card { display: none; position: absolute; left: 0; bottom: 0; width: 46%; padding: 8px 10px; background: color-mix(in srgb, var(--paper) 92%, transparent); border-top: 1px solid var(--ink); }
.x-pair__card b { display: block; font: 700 13px/1.4 var(--font-display); }
.x-pair__card .x-mono { display: block; font-size: 9px; letter-spacing: .04em; }
.x-pair figure.is-flipped .x-pair__card { display: block; }
.x-view { touch-action: pan-y; }
.x-tap { display: flex; align-items: baseline; gap: 18px; }
.x-big { padding: 0; border: 0; background: none; font: 12px var(--font-display); color: var(--ink-3); cursor: zoom-in; pointer-events: auto; }
.x-khead { display: flex; justify-content: space-between; align-items: baseline; }
.x-pair__q em { float: right; font-style: normal; color: var(--ink-3); letter-spacing: .1em; }
.x-pair__img img { cursor: zoom-in; }

/* —— 看大图 —— */
.x-lb { position: absolute; inset: 0; z-index: 40; display: none; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  background: rgba(10, 10, 9, calc(var(--bg, 1) * .97)); }
.x-lb.is-on { display: block; animation: x-lbin .28s ease; }
@keyframes x-lbin { from { opacity: 0; } }
.x-lb img { position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: 50% 50%; will-change: transform; -webkit-user-drag: none; pointer-events: none; }
.x-lb__x { position: absolute; z-index: 2; right: 14px; top: calc(env(safe-area-inset-top) + 14px); width: 42px; height: 42px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(255,255,255,.28); border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font: 300 26px/1 var(--font-sans); cursor: pointer; }
.x-lb__cap, .x-lb__rot, .x-lb__hint { transition: opacity .25s; }
.x-lb__cap { position: absolute; left: 18px; right: 130px; bottom: calc(env(safe-area-inset-bottom) + 18px); display: flex; flex-direction: column; gap: 2px; color: #e9e5dc; pointer-events: none; }
.x-lb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: linear-gradient(transparent, rgba(0,0,0,.6)); pointer-events: none; transition: opacity .25s; }
.x-lb:not(.is-ui)::after { opacity: 0; }
.x-lb__cap { z-index: 1; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.x-lb__rot { z-index: 1; }
.x-lb__cap b { font: 700 16px/1.4 var(--font-display); color: #fff; }
.x-lb__cap span { font: 10px/1.6 var(--font-mono); letter-spacing: .06em; color: #a9a397; }
.x-lb__rot { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 18px); height: 36px; padding: 0 14px; border: 1px solid rgba(255,255,255,.3); border-radius: 18px;
  background: rgba(0,0,0,.45); color: #fff; font: 13px var(--font-display); cursor: pointer; }
.x-lb__rot[hidden] { display: none; }
.x-lb__hint { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 26px); text-align: center; font: 11px var(--font-mono); letter-spacing: .14em; color: #cfc9bd; opacity: 0; pointer-events: none; }
.x-lb.is-hint .x-lb__hint { animation: x-lbhint 3.2s ease forwards; }
@keyframes x-lbhint { 10%, 75% { opacity: 1; } 100% { opacity: 0; } }
.x-lb:not(.is-ui) .x-lb__cap, .x-lb:not(.is-ui) .x-lb__rot { opacity: 0; pointer-events: none; }
.x-pair__note { margin: 12px 0 0; text-align: center; font: 13px var(--font-display); color: var(--ink-3); }

/* —— 今日之页 —— */
.x-page { display: flex; flex-direction: column; align-items: center; padding: calc(var(--vt) + 6px) 22px calc(var(--sb) + 20px); }
.x-phone { width: min(64vw, 270px, calc((100svh - 330px) * 390 / 760)); padding: 7px; border-radius: 28px; background: #111; box-shadow: 0 24px 40px -24px rgba(0,0,0,.6); }
.x-phone__in { position: relative; aspect-ratio: 390 / 760; border-radius: 22px; overflow: hidden; background: #000; }
.x-phone__in iframe { position: absolute; left: 0; top: 0; width: 390px; height: 760px; border: 0; transform-origin: 0 0; }
.x-page__cap { width: 100%; margin-top: 16px; }
.x-page__cap b { font: 900 22px var(--font-display); }
.x-page__cap p { margin: 6px 0 0; font: 14.5px/1.85 var(--font-display); color: var(--ink-2); }
.x-page .x-acts { margin-top: 14px; }

/* —— 收尾 —— */
.x-end { display: grid; place-items: center; text-align: center; padding: 0 30px; }
.x-end b { display: block; margin: 10px 0 6px; font: 900 32px/1.4 var(--font-display); }
.x-end p { margin: 0; font: 15px/1.9 var(--font-display); color: var(--ink-2); }
.x-end__link { display: inline-block; margin-top: 26px; padding: 10px 18px; border: 1px solid var(--ink); font: 14px var(--font-display); color: var(--ink); text-decoration: none; }

.x-toast { position: absolute; z-index: 20; left: 20px; right: 20px; bottom: calc(var(--sb) + 90px); padding: 12px 16px; background: var(--ink); color: var(--paper); font: 13.5px/1.7 var(--font-display);
  opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; pointer-events: none; }
.x-toast.is-on { opacity: 1; transform: none; }
.x-desk { display: none; }
@media (min-width: 1180px) { .x-desk { display: block; position: fixed; left: 32px; top: 32px; max-width: 300px; color: #cfc9bd; font: 13px/1.9 -apple-system, "PingFang SC", sans-serif; } .x-desk b { color: #fff; } }
@media (prefers-reduced-motion: reduce) { .x-img, .x-view, .x-read { transition: none; } .x-hint { animation: none; } }
.x-end__home { display: inline-block; margin-top: 18px; font: 13px var(--font-display); color: var(--ink-3); text-decoration: none; }
.x-desk a { text-decoration: none; }

/* —— 背景：墙色（取自作品）+ 顶光 + 四个角标 —— */
.x-work > * { z-index: 1; }
.x-work .x-read { z-index: 6; }
.x-work { background: color-mix(in srgb, var(--paper) 70%, var(--tint, var(--paper))); transition: background .8s; }
:root[data-theme="dark"] .x-work { background: color-mix(in srgb, var(--paper) 86%, var(--tint, var(--paper))); }
.x-work::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 48% at 50% 0%, rgba(255,252,244,.62), transparent 72%), linear-gradient(transparent 70%, rgba(0,0,0,.035)); }
:root[data-theme="dark"] .x-work::before { background: radial-gradient(55% 45% at 50% 0%, rgba(255,236,205,.13), transparent 72%), linear-gradient(transparent 70%, rgba(0,0,0,.25)); }
.x-mat { box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 34px 44px -26px rgba(0,0,0,.5); }
.x-work::after { content: ""; position: absolute; z-index: 3; inset: calc(env(safe-area-inset-top) + 18px) 12px 12px; pointer-events: none; --c: var(--ink-3); transition: opacity .4s;
  background: linear-gradient(var(--c), var(--c)) 0 0 / 18px 1px no-repeat, linear-gradient(var(--c), var(--c)) 0 0 / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 18px 1px no-repeat, linear-gradient(var(--c), var(--c)) 100% 0 / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 18px 1px no-repeat, linear-gradient(var(--c), var(--c)) 0 100% / 1px 18px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 18px 1px no-repeat, linear-gradient(var(--c), var(--c)) 100% 100% / 1px 18px no-repeat; }
.x-work.is-reading::after { opacity: 0; }
.x-work .x-top { top: calc(env(safe-area-inset-top) + 32px); left: 30px; right: 30px; }
.x-work .x-placard { left: 32px; bottom: calc(var(--sb) + 40px); }
