:root {
  --paper:#f8f7f3;
  --ink:#222824;
  --muted:#59615b;
  --line:#d8dad1;
  --accent:#954027;
  --mono:ui-monospace,SFMono-Regular,Consolas,monospace;
  --serif:"Songti SC","Noto Serif CJK SC","STSong",Georgia,serif;
  color-scheme:light
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif
}

a {
  color:inherit;
  text-decoration:none
}

button,input,select {
  font:inherit;
  color:inherit
}

button,summary {
  cursor:pointer
}

button {
  background:none;
  border:0
}

:focus-visible {
  outline:3px solid #b85230;
  outline-offset:4px
}

.wrap {
  width:min(1440px,calc(100% - clamp(32px,8vw,128px)));
  margin-inline:auto
}

.topbar,.brand,nav,nav a,.feature-top,.feature-bottom,.collection-header,.toolbar,.tabs,.searchfield,.tilebody,footer,.modalhead,.overlaycontrols {
  display:flex;
  align-items:center
}

.topbar {
  height:76px;
  justify-content:space-between
}

.brand {
  gap:10px;
  font:bold 25px/1 Georgia,serif;
  letter-spacing:-.04em
}

.brand span {
  font:600 13px/1.2 sans-serif;
  letter-spacing:.15em;
  border-left:1px solid var(--line);
  padding-left:12px
}

nav {
  gap:25px
}
nav a {
  min-height:44px;
  font-size:13px;
  font-weight:600
}
nav svg {
  width:21px;
  fill:currentColor
}
nav a:hover {
  color:var(--accent)
}

.feature {
  height:clamp(355px,36vw,520px);
  position:relative;
  isolation:isolate;
  overflow:hidden;
  border-radius:8px;
  background:#11324b;
  color:white
}

.feature>img,.feature:after {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:-2;
  object-fit:cover;
  object-position:center 53%
}

.feature:after {
  content:"";
  z-index:-1;
  background:linear-gradient(0deg,rgba(9,22,32,.72),transparent 60%),linear-gradient(176deg,rgba(6,17,30,.38),transparent 34%)
}

.feature-top,.feature-bottom {
  position:absolute;
  left:clamp(20px,3.2vw,52px);
  right:clamp(20px,3.2vw,52px);
  justify-content:space-between
}

.feature-top {
  top:26px
}
.edition,.mono {
  font-size:12px;
  font-weight:650;
  letter-spacing:.12em
}

.edition {
  display:flex;
  align-items:center;
  gap:9px
}
.edition:before {
  content:"";
  width:20px;
  height:2px;
  background:#ffd3a6
}

.mono,.tilemeta,sup {
  font-family:var(--mono);
  font-variant-numeric:tabular-nums
}

.feature-bottom {
  bottom:32px;
  align-items:flex-end
}
.feature h1 {
  font:600 clamp(42px,4.9vw,79px)/1.15 var(--serif);
  letter-spacing:.045em;
  margin:0 0 14px
}

.feature-bottom a {
  display:inline-flex;
  gap:18px;
  align-items:center;
  font-size:13px;
  font-weight:650;
  padding:5px 0;
  border-bottom:1px solid #fffc
}

.cover-controls {
  display:flex;
  align-items:center;
  gap:8px
}
.cover-controls button {
  padding:3px;
  width:58px;
  height:42px;
  border-radius:4px;
  border:1px solid transparent;
  transition:border-color .2s
}
.cover-controls img {
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:2px;
  display:block
}
.cover-controls button[aria-pressed=true],.cover-controls button:hover {
  border-color:#fff
}

#collection {
  padding-top:clamp(38px,4vw,64px);
  scroll-margin:20px
}
.collection-header,.toolbar,.tilebody,footer,.modalhead {
  justify-content:space-between
}

h2 {
  font:600 clamp(30px,3vw,46px)/1.22 var(--serif);
  letter-spacing:.03em;
  margin:0
}
sup {
  font-size:12px;
  vertical-align:top;
  margin-left:4px;
  color:var(--accent)
}

.searchfield {
  gap:9px;
  border-bottom:1px solid #a3a79d;
  min-height:41px
}
.searchfield svg {
  width:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7
}
.searchfield input {
  width:188px;
  max-width:100%;
  border:0;
  background:none;
  font-size:13px
}

.toolbar {
  margin-top:24px;
  border-block:1px solid var(--line);
  min-height:54px;
  position:relative
}

.tabs {
  gap:22px
}
.tabs button {
  min-height:53px;
  padding:0 3px;
  color:var(--muted);
  position:relative;
  font-weight:550
}
.tabs button[aria-pressed=true] {
  color:var(--ink)
}
.tabs button[aria-pressed=true]:after {
  content:"";
  position:absolute;
  bottom:-1px;
  left:0;
  width:100%;
  height:3px;
  background:var(--accent)
}

summary {
  font-size:13px;
  padding:12px 2px;
  list-style:none
}
summary::-webkit-details-marker {
  display:none
}
summary:after {
  content:"⌄";
  margin-left:8px
}

.filters {
  position:absolute;
  z-index:2;
  right:0;
  top:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  padding:12px;
  background:var(--paper);
  border:1px solid var(--line);
  box-shadow:0 8px 20px #2222
}

.control {
  background:white;
  border:1px solid var(--line);
  border-radius:3px;
  padding:8px;
  font-size:13px
}

#resultCount {
  color:var(--muted);
  font-size:12px;
  margin:14px 0
}

.gallery {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:26px 18px
}

.tile {
  display:block;
  width:100%;
  text-align:left;
  padding:0
}
.thumb {
  aspect-ratio:16/10;
  background:#dddcd5;
  overflow:hidden;
  border-radius:5px
}

.thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .32s ease-out
}
.tile:hover .thumb img {
  transform:scale(1.027)
}
.tilebody {
  gap:8px;
  margin-top:8px
}
.tilename {
  font:550 14px/1.5 var(--mono);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.tilemeta {
  font-size:11px;
  color:var(--muted);
  white-space:nowrap
}

.empty {
  grid-column:1/-1;
  text-align:center;
  padding:60px 10px;
  color:var(--muted)
}
.empty strong {
  display:block;
  color:var(--ink);
  margin-bottom:8px
}

.loadmore,.action,.iconbutton {
  border:1px solid var(--line);
  border-radius:4px;
  background:var(--paper)
}
.loadmore {
  display:block;
  padding:11px 20px;
  margin:30px auto
}
.loadmore:hover,.action:hover,.iconbutton:hover {
  border-color:var(--ink)
}

[hidden] {
  display:none!important
}

footer {
  border-top:1px solid var(--line);
  margin-top:54px;
  padding:22px 0 32px;
  font-size:12px;
  color:var(--muted)
}

dialog {
  padding:0;
  border:0;
  border-radius:8px;
  width:min(1180px,94vw);
  max-height:92dvh;
  overflow:auto;
  color:var(--ink);
  background:var(--paper)
}

dialog::backdrop {
  background:#0d1519e8
}

.modalhead {
  padding:10px 16px;
  border-bottom:1px solid var(--line)
}
.modalhead strong {
  font:600 16px var(--mono)
}
.iconbutton {
  min-width:40px;
  height:40px;
  font-size:20px
}

.modalcontent {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(215px,24%)
}
.fullimage {
  position:relative;
  background:#141819;
  display:grid;
  place-items:center;
  min-height:330px
}
.fullimage img {
  width:100%;
  height:min(68dvh,720px);
  object-fit:contain
}
.overlaycontrols {
  position:absolute;
  bottom:15px;
  right:15px;
  gap:6px
}

.modalaside {
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:14px
}
.asidekey,.muted {
  font-size:12px;
  color:var(--muted)
}
.asidevalue,.tag {
  font-size:14px;
  overflow-wrap:anywhere
}
.asidebottom {
  display:grid;
  gap:8px;
  margin-top:auto
}
.action {
  padding:9px 12px;
  font-size:14px;
  text-align:center
}
.primary {
  background:var(--ink);
  color:white
}

.toast {
  position:fixed;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  pointer-events:none;
  opacity:0;
  background:var(--ink);
  color:white;
  padding:10px 15px;
  border-radius:4px
}
.toast.visible {
  opacity:1
}

@media(max-width:850px) {
  .gallery {
  grid-template-columns:repeat(2,minmax(0,1fr))
}
.modalcontent {
  grid-template-columns:1fr
}
.fullimage {
  min-height:180px
}
.fullimage img {
  height:45dvh
}
.modalaside {
  gap:10px
}
.feature-bottom {
  bottom:22px
}

}

@media(max-width:550px) {
  .topbar {
  height:60px
}
.brand {
  font-size:21px
}
.feature {
  height:345px
}
.feature-top {
  top:18px
}
.feature-bottom {
  display:block
}
.cover-controls {
  position:absolute;
  bottom:0;
  right:0;
  gap:2px
}
.cover-controls button {
  width:36px;
  height:30px
}
.collection-header {
  display:block
}
.searchfield {
  margin-top:15px
}
.searchfield input {
  width:100%;
  min-height:40px
}
.toolbar {
  margin-top:13px
}
.tabs {
  gap:14px
}
.gallery {
  grid-template-columns:1fr;
  gap:21px
}
.tilebody {
  margin-top:6px
}
.feature h1 {
  font-size:43px
}
#collection {
  padding-top:32px
}
.modalaside {
  padding:13px
}
.fullimage img {
  height:35dvh
}

}

@media(prefers-reduced-motion:reduce) {
  * {
  transition:none!important
}

}

