/* 科学史与学术 · an oxblood gallery.
   The article hangs in a gilt frame under a spotlight, its facts sit on a museum label,
   the text is a mounted panel, and footnotes hang beside the line that cites them. */

.w-hps {
  --bg: #4B161A; --paper: #F5F3EC; --ink: #F1E7D2; --muted: #CDB99A; --line: rgba(226, 201, 143, .26);
  --acc: #E2C98F; --acc-ink: #2A1A10; --f-body: var(--f-serif);
  --brass: #B08D57; --ox: #6A2328; --label: #F5F3EC; --label-ink: #1E211E; --label-muted: #5D615A;
  background-color: #4B161A;
  background-image:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 6px),
    linear-gradient(#5B1C21, #43131A 900px, #3E1217);
}
.w-hps .bar { background: rgba(58, 16, 20, .94); border-bottom-color: rgba(176, 141, 87, .5); }
.w-hps .bar__logo { padding: 3px; background: var(--label); box-shadow: 0 0 0 1px var(--brass); }
.w-hps .bar__logo img { width: 34px; height: 34px; }
.w-hps .bar__nav .nav__a { font-family: var(--f-serif); }
.w-hps .bar__nav .nav__a[aria-current="page"] { border-bottom-color: var(--acc); }
.w-hps .bar__btn { border-color: rgba(226, 201, 143, .4); border-radius: 0; }
.w-hps .bar__btn[aria-pressed="true"] { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }

/* ---------- hero: frame + label under a spotlight ---------- */
.w-hps .ah { width: min(1240px, calc(100% - 64px)); margin: 0 auto; padding-top: 70px; }
.w-hps .ah::before {
  content: ""; position: absolute; z-index: 0; left: -20%; right: 22%; top: -70px; height: 900px; pointer-events: none;
  background: radial-gradient(50% 58% at 50% 34%, rgba(255, 236, 196, .2), transparent 70%);
  animation: hps-light 1.6s ease-out .2s both;
}
@keyframes hps-light { 0% { opacity: 0; } 30% { opacity: .9; } 38% { opacity: .25; } 52% { opacity: 1; } 60% { opacity: .55; } 100% { opacity: 1; } }
.w-hps .ah__wall { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 7.2fr) minmax(0, 4fr); gap: 64px; align-items: end; }

.w-hps .ah__frame {
  position: relative; padding: 20px;
  background: linear-gradient(135deg, #7E5E2A, #E5CB8C 18%, #9B7A3B 38%, #F2DDA4 55%, #8C6B32 76%, #D9BC7C 92%);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .5), inset 0 0 0 6px rgba(60, 40, 12, .35), 0 40px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px #2A1A10;
}
.w-hps .ah__mat { display: block; padding: 22px; background: #EDE6D3; box-shadow: inset 0 2px 8px rgba(40, 24, 8, .45); }
.w-hps .ah__pic { position: relative; display: block; cursor: zoom-in; overflow: hidden; box-shadow: 0 0 0 1px rgba(60, 40, 12, .3); }
.w-hps .ah__pic img { width: 100%; height: auto; }
.w-hps .loupe {
  position: absolute; z-index: 3; width: 210px; height: 210px; margin: -105px 0 0 -105px; border-radius: 50%; pointer-events: none;
  background: #EDE6D3 no-repeat;
  box-shadow: 0 0 0 4px #2A1A10, 0 0 0 6px #B08D57, inset 0 0 18px rgba(0, 0, 0, .35), 0 20px 34px rgba(0, 0, 0, .5);
}

.w-hps .ah__label {
  position: relative; padding: 30px 30px 26px; color: var(--label-ink); background: var(--label);
  box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(154, 122, 58, .55), inset 0 0 0 6px var(--label), inset 0 0 0 7px rgba(154, 122, 58, .35);
}
.w-hps .ah__cat { display: inline-block; font-size: 14px; color: var(--ox); border-bottom: 1px solid currentColor; font-family: var(--f-serif); }
.w-hps .ah__cat:hover { color: #1E211E; }
.w-hps .ah__t { margin-top: 16px; font-family: var(--f-serif); font-weight: 900; font-size: 36px; line-height: 1.32; letter-spacing: .01em; text-wrap: balance; }
.w-hps .ah__by { margin-top: 12px; font-family: var(--f-serif); font-size: 16px; }
.w-hps .ah__lede { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(154, 122, 58, .5); font-family: var(--f-serif); font-size: 15.5px; line-height: 1.9; color: #33362F; }
.w-hps .ah__meta { margin-top: 16px; display: grid; gap: 4px; font-size: 13.5px; font-family: var(--f-serif); }
.w-hps .ah__meta dt { color: var(--label-muted); min-width: 2.6em; }
.w-hps .ah__no { position: absolute; right: 22px; top: 24px; font-family: "EB Garamond", var(--f-serif); font-style: italic; font-size: 17px; color: #8A6B2E; }
.w-hps .ah__cap { position: relative; z-index: 1; margin-top: 18px; max-width: 760px; font-family: var(--f-serif); font-size: 14px; color: var(--muted); }

/* ---------- the text, mounted as a panel ---------- */
.w-hps .ag { margin-top: 84px; }
.w-hps .toc h2 { color: var(--muted); font-family: var(--f-serif); }
.w-hps .toc a { color: #D9C7A6; font-family: var(--f-serif); border-radius: 0; }
.w-hps .toc a:hover { color: #FFFFFF; }
.w-hps .toc a[aria-current="true"] { background: none; color: #FFFFFF; box-shadow: inset 2px 0 0 var(--acc); }

.w-hps .prose {
  --ink: #1E211E; --muted: #5D615A; --line: rgba(30, 33, 30, .15); --bg: #F5F3EC; --acc: #7A2A2E;
  position: relative; padding: 58px 64px 64px; color: var(--ink); background: var(--label);
  box-shadow: 0 34px 60px -34px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(154, 122, 58, .6), inset 0 0 0 9px var(--label), inset 0 0 0 10px rgba(154, 122, 58, .3);
}
.w-hps .prose > :first-child { font-size: 15px; line-height: 1.9; color: var(--muted); }
.w-hps .prose :is(h2, h3) { margin-top: 2.3em; font-size: 23px; line-height: 1.5; }
.w-hps.deco .prose :is(h2, h3) { position: relative; padding-top: 20px; font-weight: 900; color: var(--ox); }
.w-hps.deco .prose :is(h2, h3)::before { content: ""; position: absolute; top: 0; left: 0; width: 46px; height: 3px; background: var(--brass); }
.w-hps .prose .fn a { display: inline-grid; place-items: center; width: 19px; height: 19px; margin: 0 2px; border-radius: 50%; background: var(--ox); color: var(--label); font: italic 600 13px/1 "EB Garamond", var(--f-serif); text-decoration: none; vertical-align: 3px; }
.w-hps .prose .fn a:hover { background: #1E211E; }
.w-hps .cut::before { background: linear-gradient(rgba(245, 243, 236, 0), #F5F3EC); }
.w-hps.is-plain .sn { position: static; width: auto; margin: 1em 0 0 !important; padding: 12px 14px; transform: none; color: #333333; background: #F4F4F4; }
.w-hps.is-plain .sn::before { display: none; }

/* footnotes hang in the margin, level with the paragraph that cites them */
.w-hps .sn { position: absolute; right: -276px; width: 220px; margin: 0 !important; transform: translateY(-100%); font-family: var(--f-serif); font-size: 13px; line-height: 1.7; text-align: left; color: #E6D6B8; }
.w-hps .sn b { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 6px; border-radius: 50%; background: var(--brass); color: #2A1A10; font: italic 600 13px/1 "EB Garamond", var(--f-serif); }
.w-hps .sn::before { content: ""; display: block; width: 46px; height: 1px; margin-bottom: 10px; background: var(--brass); }

.w-hps .rail { position: static; }
.w-hps .rail__note { padding: 0; color: #D9C7A6; font-family: var(--f-serif); }
.w-hps .rail__note b { color: var(--acc); font-weight: 600; }
.w-hps .rail__note p { color: #CDB99A; }
.w-hps .rail__btn { border-color: rgba(226, 201, 143, .45); color: #EADBB4; font-family: var(--f-serif); }
.w-hps .rail__btn:hover { background: var(--acc); color: var(--acc-ink); }

/* ---------- end matter on the wall ---------- */
.w-hps .ae h2 { font-family: var(--f-serif); font-weight: 600; color: var(--muted); }
.w-hps .tags a { font-family: var(--f-serif); color: #EADBB4; border-color: rgba(226, 201, 143, .45); }
.w-hps .tags a:hover { background: var(--acc); color: var(--acc-ink); }
.w-hps .author { color: var(--label-ink); background: var(--label); box-shadow: inset 0 0 0 1px rgba(154, 122, 58, .6), inset 0 0 0 7px var(--label), inset 0 0 0 8px rgba(154, 122, 58, .3); }
.w-hps .author img { filter: sepia(.35) contrast(1.05); }
.w-hps .author h3 { font-family: var(--f-serif); font-weight: 900; }
.w-hps .author p, .w-hps .author h3 small { color: var(--label-muted); }
.w-hps .pn__l { color: var(--muted); font-family: var(--f-serif); }

/* comments: the visitors' book */
.w-hps .cmt__list {
  padding: 10px 30px; color: var(--label-ink); background: #F3EEDF;
  box-shadow: 0 24px 40px -26px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(154, 122, 58, .55);
}
.w-hps .cmt__one + .cmt__one { border-top: 1px solid rgba(154, 122, 58, .45); }
.w-hps .cmt__one { padding: 18px 0; grid-template-columns: 40px minmax(0, 1fr); }
.w-hps .cmt__one i { background: var(--ox); color: var(--label); font-family: var(--f-serif); }
.w-hps .cmt__one b { font-family: var(--f-serif); }
.w-hps .cmt__one time { color: var(--label-muted); font-family: "EB Garamond", var(--f-serif); font-size: 14px; }
.w-hps .cmt__one p { font-family: var(--f-serif); }
.w-hps .cmt__au { margin-left: 8px; padding: 0 6px; font-size: 12px; color: var(--label); background: var(--ox); }
.w-hps .cmt__form label { color: var(--muted); }
.w-hps .cmt__form textarea { color: var(--label-ink); background: var(--label); border-color: transparent; font-family: var(--f-serif); }
.w-hps .cmt__form button { background: var(--acc); color: var(--acc-ink); font-family: var(--f-serif); }

.w-hps .ft { border-top-color: rgba(176, 141, 87, .4); }
.w-hps .ft__brand img { padding: 3px; background: var(--label); mix-blend-mode: normal; }
.w-hps .sub input[type="email"] { border-color: rgba(226, 201, 143, .4); }
.w-hps .sub button { background: var(--acc); color: var(--acc-ink); }

@container yh (max-width: 760px) {
  .w-hps .ah { width: calc(100% - 32px); padding-top: 28px; }
  .w-hps .ah::before { left: -30%; right: -30%; height: 600px; }
  .w-hps .ah__wall { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .w-hps .ah__frame { padding: 10px; }
  .w-hps .ah__mat { padding: 10px; }
  .w-hps .ah__label { padding: 24px 20px 20px; }
  .w-hps .ah__t { font-size: 28px; padding-right: 64px; }
  .w-hps .ah__cap { font-size: 13px; }
  .w-hps .ag { margin-top: 40px; }
  .w-hps .prose { padding: 30px 22px 36px; margin-inline: -4px; }
  .w-hps .prose :is(h2, h3) { font-size: 21px; }
  .w-hps .sn { position: static; width: auto; margin: 1em 0 0 !important; padding: 12px 14px; transform: none; color: #33362F; background: #EBE5D6; }
  .w-hps .sn::before { display: none; }
  .w-hps .cmt__list { padding: 12px 18px 16px; }
}
